(281) commits
feat: support multiple stores registering the same thunk (#51)
d0a8540
(v0.13.4)
Vlad
·
14 Nov 24
feat: support multiple stores registering the same thunk (#51) * feat(thunk): enable multiple stores to register thunks with unique identifiers * refactor(store): remove unused getStoreId function
Vlad
·
03 Oct 24
refactor(persist): update persist.ts (#50) Refactor persist.ts to improve code organization and readability. - Add support for transform functions to modify the state before storing and after retrieving from storage. - Implement inbound and outbound transformers to handle state transformations. - Handle errors thrown by transformers and log them to the console. - Use the transformed state when reconciling and persisting the store. - Update persistStoreMdw function to use the transformed state when saving to storage. - Add tests for persist transformers
Eric Bower
·
03 Oct 24
fix: unregister a thunk when the operation shuts down
chore: update esm.sh to latest
6fd92f8
(v0.13.3)
Eric Bower
·
02 Oct 24
chore: update esm.sh to latest
Eric Bower
·
02 Oct 24
chore: cleanup thunk registry fix
Vlad
·
11 Sep 24
fix(thunk): prevent multiple calls to `.register`
Eric Bower
·
19 Aug 24
chore(react): export `useStore` hook
docs(loaders): meta code example
9f21d7e
Eric Bower
·
18 Aug 24
docs(loaders): meta code example
Eric Bower
·
18 Aug 24
docs(learn): preload then refresh
fix(thunk): run thunk supervisors immediately on register
2a61af0
(v0.13.2)
Eric Bower
·
16 Aug 24
fix(thunk): run thunk supervisors immediately on register For whatever reason, dispatching actions to register all the supervisor thunks was too slow and causing a regression with prod systems. This reverts part of the register function to how it used to work. To be more specific, it calls the supervisor functions immediately in a `parallel` call.
Eric Bower
·
16 Aug 24
chore(thunk): use `console.warn` instead of `console.error`
fix(thunk): remove unnecessary error log
14f1594
(v0.13.1)
Eric Bower
·
14 Aug 24
fix(thunk): remove unnecessary error log
refactor: enhanced thunk registry system (#44)
6ca0a85
(v0.13.0)
Eric Bower
·
30 Jul 24
refactor: enhanced thunk registry system (#44) The current registry system for thunks works like this: - User calls `const thunks = createThunks()` - User creates **all** thunks `const go = thunks.create("go")` - User registers thunks `store.run(thunks.bootup)` However, there's a caveat with this implementation: all thunks must be created before `store.run` is called. Further, since thunks are created at the module-level, if the module that exports those thunks isn't loaded before `thunk.bootup` is called then those thunks are silently ignored. This change will make it so it doesn't matter when a thunk is created, we will "lazy load" it. We still require `store.run(thunks.bootup)` to be called -- because we need access to the store and won't have it when creating a thunk. We are also sending an error whenever a thunk is dispatched without it being registered which should help ensure thunks get properly registered. We also changed the name of `thunks.bootup` to `thunks.register` to make it more clear that this is a registry system.
Eric Bower
·
10 Jun 24
docs: update pdocs and reframe lib
fix: catch error and bubble up
17b2c15
(v0.12.0)
Eric Bower
·
07 May 24
fix: catch error and bubble up
fix(mdw): thunk loader needs `ctx.loader`
f47ecce
(v0.11.0)
Eric Bower
·
15 Apr 24
fix(mdw): thunk loader needs `ctx.loader`
refactor: remove Result.data
6313833
(v0.10.0)
Eric Bower
·
05 Mar 24
refactor: remove Result.data BREAKING CHANGE: `ctx.json` no longer has a `.data` property
Eric Bower
·
04 Mar 24
refactor: merge `starfx/store` into `starfx` (#43) I'm looking for ways to simplify the API in order to make this lib more ergonomic. DEPRECATED: `configureStore` is now `createStore` BREAKING CHANGE: removed `starfx/store`
Eric Bower
·
23 Feb 24
chore: make clearTimers more ergonomic (#42)
feat: clear timers (#41)
d0a0d68
Eric Bower
·
23 Feb 24
feat: clear timers (#41) feat: use `race` from `effection` BREAKING CHANGE: replace `race` with `raceMap`
chore: deprecate `slice.loader`
ed75824
(v0.7.2)
Eric Bower
·
23 Feb 24
chore: deprecate `slice.loader` Use `slice.loaders` instead
fix: reset loader when task is cancelled (#40)
072dd5b
(v0.7.1)
Eric Bower
·
22 Feb 24
fix: reset loader when task is cancelled (#40) This issue happens when: - User runs a task with a loader - Loading is in "loading" state - Task gets halted - Loader does not get cleaned up - Loader stays in "loading" state
chore: dont prefix action types
e582179
(v0.6.0)
Eric Bower
·
07 Feb 24
chore: dont prefix action types BREAKING CHANGE: we removed `@@starfx:` from all action types
Eric Bower
·
06 Feb 24
fix(thunk): `toString` must return `type` instead of `name`
ecosystem CI tests (#36)
54f6fc8
Jacob Bolda
·
30 Jan 24
ecosystem CI tests (#36) * initial CI setup * fix CI workflow name * consistent CI workflow name with file name * script to symlink and CI workflow update to run build * fix folder name in example dir * try --refresh-lockfile * try with npm * try with --no-lockfile * try with npm including build * npm run build * run as matrix * don't fail fast * skip remove of ./npm/node_modules * do file: install for parcel instead * keep node_modules for parcel * matrix out path chunks * lint fix * another lint fix * fix CI name * install both examples * dynamically pull matching branch * nested folder * quiet script * throw on failed reponse * pass branch * more error context * bad boop * name branch step * lint * build and test examples * remove GITHUB_TOKEN * directly append in script * add logs * dump output * dump output file * dump step * .outputs * lint * really need to fix my local linter * add a bit to the readme * rename .scripts/ to scripts/ * update script references
refactor: remove `log` (#35)
cab4009
Eric Bower
·
23 Jan 24
refactor: remove `log` (#35) refactor: removed wrapped spawn from take helpers BREAKING CHANGE: take helper fn signatures are different BREAKING CHANGE: no more log or `LogContext`
fix: parcel bundler import export destructuring
7fa2483
(v0.5.2)
Eric Bower
·
21 Jan 24
fix: parcel bundler import export destructuring For whatever reason, parcel doesn't like that we are importing from "thunk" and exporting at the same time.
chore: folder/file org cleanup (#33)
98a9de7
(v0.5.1)
Eric Bower
·
19 Jan 24
chore: folder/file org cleanup (#33)
refactor(query): better extract types from endpoints
531fbae
(v0.4.1)
Eric Bower
·
11 Jan 24
refactor(query): better extract types from endpoints - fix(query): pick correct `ApiError` type inside `createApi` - `useCache` will automatically pull success type from endpoint.
refactor(store): export storeMdw as collection
f43c20f
(v0.4.0)
Eric Bower
·
10 Jan 24
refactor(store): export storeMdw as collection
fix(loader): consistent state shape
3baf359
(v0.3.11)
Eric Bower
·
08 Jan 24
fix(loader): consistent state shape
fix(loader): dont save derived data inside slice
9775bca
(v0.3.10)
Eric Bower
·
08 Jan 24
fix(loader): dont save derived data inside slice
feat(query): generic loader mdw
654cbc5
Eric Bower
·
06 Jan 24
feat(query): generic loader mdw
Eric Bower
·
06 Jan 24
chore(query): cleanup mdw.predicate
fix: flatten PersistGate elements
bb56c4c
(v0.3.9)
Eric Bower
·
03 Jan 24
fix: flatten PersistGate elements
fix(table): properly memoize `selectByIds`
064d6fe
(v0.3.8)
Eric Bower
·
03 Jan 24
fix(table): properly memoize `selectByIds`
Eric Bower
·
03 Jan 24
chore(query): export useCache type
feat(store): add local storage adapter
fb0b016
(v0.3.7)
Eric Bower
·
18 Dec 23
feat(store): add local storage adapter
fix(store): persistor rehydrates properly now
be72c77
(v0.3.5)
Eric Bower
·
17 Dec 23
fix(store): persistor rehydrates properly now
fix(store): cache timer mdw
7b1c7d5
(v0.3.4)
Eric Bower
·
16 Dec 23
fix(store): cache timer mdw
Eric Bower
·
16 Dec 23
chore: rename files and remove old fx
refactor(log): generalize for any logging not just errors
93fb0c8
(v0.3.3)
Eric Bower
·
14 Dec 23
refactor(log): generalize for any logging not just errors
fix(slice): properly memoize loader selectors
7a9702e
(v0.3.2)
Eric Bower
·
14 Dec 23
fix(slice): properly memoize loader selectors
fix: wrong type for slice.any
4ca821e
(v0.3.1)
Eric Bower
·
14 Dec 23
fix: wrong type for slice.any
Eric Bower
·
13 Dec 23
chore: remove `first` from upstream
Eric Bower
·
12 Dec 23
feat(store): `reset` updater to revert store to initialState provided by user
Eric Bower
·
12 Dec 23
feat(slice.table): return empty value provided for reuse
chore: remove outdated selectors
bd72fb5
Eric Bower
·
12 Dec 23
chore: remove outdated selectors
refactor(store): `slice.table` `empty` is now optional (#28)
059dd3b
(v0.2.1)
Eric Bower
·
01 Dec 23
refactor(store): `slice.table` `empty` is now optional (#28)
Eric Bower
·
01 Dec 23
feat(query): thunk and api thunks can simply accept payload (#29)
fix: export persist module
8f49b0c
(v0.2.0)
Eric Bower
·
01 Dec 23
fix: export persist module
Eric Bower
·
01 Dec 23
fix(thunk): add `.use` to `CreateActionWithPayload` (#27)
Eric Bower
·
01 Dec 23
feat(store): redux-persist replacement (#21)
Eric Bower
·
01 Dec 23
feat: `createBatchMdw` for batching store listener events (#22)
Eric Bower
·
01 Dec 23
refactor: require data and loaders slices (#24)
chore: update effection@v3-beta.3
b0613a8
(v0.1.0)
Eric Bower
·
30 Nov 23
chore: update effection@v3-beta.3
Eric Bower
·
30 Nov 23
feat: thunks dynamic mdw api (#26)
Eric Bower
·
22 Nov 23
refactor(query): middleware naming (#25)
Eric Bower
·
19 Nov 23
refactor(npm): use deno arg instead of env var
refactor(fx): use `call` from `effection` (#20)
c6193ae
(v0.0.34)
Eric Bower
·
14 Nov 23
refactor(fx): use `call` from `effection` (#20)
fix(gha): trailing slash rsync
5dd4a44
Eric Bower
·
11 Nov 23
fix(gha): trailing slash rsync
refactor(redux): custom queue impl (#19)
a4c160f
(v0.0.33)
Eric Bower
·
10 Nov 23
refactor(redux): custom queue impl (#19)
fix(redux): `poll` supervisor correct call sig
2086bda
(v0.0.32)
Eric Bower
·
13 Oct 23
fix(redux): `poll` supervisor correct call sig
Eric Bower
·
13 Oct 23
chore: rm references to `saga-query`
chore: update `effection` to `beta.0`
307ecf0
(v0.0.31)
Eric Bower
·
13 Oct 23
chore: update `effection` to `beta.0`
chore: update effection v3.0.15
7371451
Eric Bower
·
02 Oct 23
chore: update effection v3.0.15
refactor(redux): take strat
4842df8
(v0.0.30)
Eric Bower
·
18 Sep 23
refactor(redux): take strat Trying to think about performance considerations with implementation
refactor(redux): use signal for middleware
0ba8393
(v0.0.28)
(v0.0.29)
Eric Bower
·
17 Sep 23
refactor(redux): use signal for middleware
chore(redux): export `send` for debugging
4d4f2d8
(v0.0.27)
Eric Bower
·
16 Sep 23
chore(redux): export `send` for debugging
refactor(redux): use signal instead of channel
30e8e88
(v0.0.26)
Eric Bower
·
16 Sep 23
refactor(redux): use signal instead of channel
fix(redux): dispatchActions needs batchActions
9bffca8
(v0.0.25)
Eric Bower
·
16 Sep 23
fix(redux): dispatchActions needs batchActions
chore: type improvements
ed175e3
(v0.0.24)
Eric Bower
·
16 Sep 23
chore: type improvements
chore: modify supervisor types
8b15e81
(v0.0.23)
Eric Bower
·
16 Sep 23
chore: modify supervisor types
chore: export more redux fns
5b3374e
(v0.0.22)
Eric Bower
·
16 Sep 23
chore: export more redux fns
chore: export supervisors
e18a41f
(v0.0.21)
Eric Bower
·
16 Sep 23
chore: export supervisors
chore: update deps
e0dffb4
(v0.0.20)
Eric Bower
·
15 Sep 23
chore: update deps chore: update `saga-query` changes
refactor(store/slice): rename `obj.patch` to `obj.update`
e1ff96d
(v0.0.19)
Vlad
·
12 Sep 23
refactor(store/slice): rename `obj.patch` to `obj.update`
fix: imports for `starfx/react`
3a918f0
(v0.0.18)
Eric Bower
·
10 Sep 23
fix: imports for `starfx/react`
Merge pull request #13 from neurosnap/create-table
f2722e4
(v0.0.17)
Eric Bower
·
10 Sep 23
Merge pull request #13 from neurosnap/create-table --------- Co-authored-by: Vlad <vladmarginean@softwiz.ro>
feat: schema concept
48ff5d6
Vlad
·
29 Jul 23
feat: schema concept Schema is like a database schema: you specify what tables you want and their shape. The goal of this feature is to help users build an immutable data store that resembles a database, with ways to change the data being store as well as query it. New features: - `createSchema` which will generate the `initialState` for `createStore` - `table()` which will create a table slice - `str()` which will create a string slice - `num()` which will create a number slice - `any()` which will create a generic slice with any type - `obj()` which will create an object slice ```ts import { createSchema, configureStore, slice, select } from 'starfx/store'; import { main } from 'starfx'; interface User { id: string; name: string; } const { db, initialState } = createSchema({ users: slice.table<User>({ empty: { id: "", name: "" } }), }); const store = configureStore({ initialState }); main(function*() { yield* schema.update(db.users.add({ "1": { id: "1", name: "bob" } })); const user = yield* select(db.users.selectById, { id: "1" }); }); ```
Eric Bower
·
02 Sep 23
doc: readme update with references
Toolkit 2.0 (#11)
a80c485
Eric Bower
·
28 Aug 23
Toolkit 2.0 (#11) feat: added `prepareStore()` BREAKING CHANGE: refactored `configureStore()` from `starfx/redux`
refactor: `call()` to not be safe (#9)
86db183
(v0.0.14)
Eric Bower
·
27 Aug 23
refactor: `call()` to not be safe (#9)
fix: bubble errors up properly
912155b
(v0.0.13)
Eric Bower
·
30 Jul 23
fix: bubble errors up properly
fix: `errorHandler` properly catch errors
25ec8ea
(v0.0.12)
Eric Bower
·
30 Jul 23
fix: `errorHandler` properly catch errors
fix: event inside takeEvery can trigger same event (#5)
cdc5721
(v0.0.11)
Eric Bower
·
30 Jul 23
fix: event inside takeEvery can trigger same event (#5) This is a regression from `saga-query`. This is an issue that came up in `redux-saga`. [See ref to original issue.](https://github.com/redux-saga/redux-saga/issues/277) [Discussion in discord](https://discordapp.com/channels/700803887132704931/1108053742835736636)
fix: ensure compose mdw returns aggregate `Result` (#6)
6d5ec93
(v0.0.10)
Eric Bower
·
30 Jul 23
fix: ensure compose mdw returns aggregate `Result` (#6) There was a regression compared to `saga-query` for `createPipe()` where we were swallowing errors in the mdw pipeline. This is largely because we are experimenting with the idea of ensuring all operations inside `starfx` are safe-by-default and return a `Result` instead of `throw`. This effort is a design decision to treat errors-as-data. In order to support safe-by-default inside our `compose()` function, we need to aggregate the `Result` of every mdw call and then attach an aggregate `Result` onto the `ctx` provided to `compose()`. So now we require at least one field to always exist on `ctx` which is `ctx.result` which returns `Result<any[]>`. If an error exists inside the aggregate results, we return it unwrapped as an error. If no error exists in the results then we return a single `Result` with a list of values unwrapped. Here is a test that demonstrates the new behavior: ```ts it(tests, "error inside endpoint mdw", async () => { let called = false; const query = createPipe(); query.use(function* (ctx, next) { yield* next(); if (!ctx.result.ok) { called = true; } }); query.use(query.routes()); const fetchUsers = query.create( `/users`, { supervisor: takeEvery }, function* processUsers() { throw new Error("some error"); }, ); const store = await configureStore({ initialState: { ...createQueryState(), users: {}, }, }); store.run(query.bootup); store.dispatch(fetchUsers()); asserts.assertEquals(called, true); }); ```
refactor: switch default createPipe() supervisor to redux
a57267b
(v0.0.8)
Eric Bower
·
14 Jul 23
refactor: switch default createPipe() supervisor to redux
add enhancers to redux store (#3)
7629481
(v0.0.5)
Vlad
·
11 Jul 23
add enhancers to redux store (#3)
Eric Bower
·
10 Jul 23
fix: double take on same event (#4)
Eric Bower
·
27 May 23
fix(npm): generate esm-specific types
Eric Bower
·
22 May 23
chore: use mod.ts for entry points
chore: more natural npm imports
a1c5a9c
Eric Bower
·
21 May 23
chore: more natural npm imports
Eric Bower
·
21 May 23
chore: refactor redux store creator
Eric Bower
·
20 May 23
feat(query): Data synchronization using a middleware system for front-end apps (#1)
Eric Bower
·
20 Apr 23
feat: `compose` function for middleware
Eric Bower
·
20 Apr 23
refactor: `call` returns `Result` now
Eric Bower
·
20 Apr 23
chore(fx): replaced `all` with `parallel`
Eric Bower
·
28 Mar 23
chore: getting ready for initial release