repos / starfx

a micro-mvc framework for react apps
git clone https://github.com/neurosnap/starfx.git

(299) commits
Eric Bower  ·  2025-07-12
docs: `stale-while-revalidate` messaging
Jacob Bolda  ·  2025-07-07
fix: examples and have them install starfx locally (#65)

Jacob Bolda  ·  2025-07-07
react-redux as optional peerDep (#63)

64ac583
(v0.14.6)
Eric Bower  ·  2025-07-07
chore: v0.14.6
783202c
(v0.14.5)
Vlad  ·  2025-06-15
Refactor matcher for correct predicate and action handling (#62)

- Brand action creators using a cheap, non-enumerable _starfx property for precise detection.
- Refactor matcher logic to clearly separate branded action creators from custom predicates and all other cases.
- This ensures only the intended actions are matched, fixes the failing test, and makes the matcher safe for userland/test usage and advanced patterns.
- Additionally added matcher.test.ts to outline matcher behavior and edge cases, ensuring future changes remain safe.
- Also added index signature to ActionWithPayload to ensure that is compatible with react-redux UnknownAction type [type.ts]
9f955d2
(v0.14.4)
Eric Bower  ·  2025-06-06
chore: release
181d0d0
(v0.14.3)
Eric Bower  ·  2025-06-06
fix: gha
c1fc305
(v0.14.2)
Eric Bower  ·  2025-06-06
fix: gha
d01c111
(v0.14.1)
Eric Bower  ·  2025-06-06
chore: release gha
0a6e572
(v0.14.0)
Eric Bower  ·  2025-06-06
fix(react): exports entry (#61)

Eric Bower  ·  2025-06-06
deno to node (#60)

This changes the language runtime from deno to node. The reason for this change is because the target of this library is the browser and node has the best compatibility with it. Further we were running into a bunch of issues with the deno tooling for creating npm packages (e.g. dnt).

deno is also pretty good at loading npm packages into its runtime so starting in deno doesn't help us that much.

Ultimately there's just a few too many layers in between us and the npm release and at this point deno is not really serving us.

---------

Co-authored-by: Vlad <vladmarginean@softwiz.ro>
Eric Bower  ·  2025-06-01
docs: preload copy
Vlad  ·  2025-04-19
Merge pull request #58 from neurosnap/preview-package-workflow

preview package creation on PR
Jacob Bolda  ·  2025-04-04
preview package creation on PR
Eric Bower  ·  2025-01-04
fix(make): change test cmd
Jacob Bolda  ·  2025-01-04
confirm tests assert when run within an generator function (#55)

---------

Co-authored-by: Vlad Marginean <vladmarginean@softwiz.ro>
Jacob Bolda  ·  2024-12-21
refactor: deno v2 and imports

Eric Bower  ·  2024-12-19
chore: rm static workflow
Eric Bower  ·  2024-11-17
chore: cache bust css
Eric Bower  ·  2024-11-16
style: docs
d0a8540
(v0.13.4)
Vlad  ·  2024-11-14
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
Eric Bower  ·  2024-10-17
style: home
Vlad  ·  2024-10-03
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  ·  2024-10-03
fix: unregister a thunk when the operation shuts down
6fd92f8
(v0.13.3)
Eric Bower  ·  2024-10-02
chore: update esm.sh to latest
Eric Bower  ·  2024-10-02
chore: update deno.lock file
Eric Bower  ·  2024-10-02
chore: cleanup thunk registry fix
Vlad  ·  2024-09-10
fix(thunk): prevent multiple calls to `.register`
Eric Bower  ·  2024-08-28
docs: structured conc
Eric Bower  ·  2024-08-27
docs: copy
Eric Bower  ·  2024-08-26
docs: copy
Eric Bower  ·  2024-08-26
docs: copy
Eric Bower  ·  2024-08-26
docs: copy
Eric Bower  ·  2024-08-26
docs: nav
Eric Bower  ·  2024-08-26
docs: copy
Eric Bower  ·  2024-08-26
docs: copy
Eric Bower  ·  2024-08-26
fix: fmt
Eric Bower  ·  2024-08-26
docs: copy
Eric Bower  ·  2024-08-26
docs: copy
Eric Bower  ·  2024-08-25
docs: fx
Eric Bower  ·  2024-08-25
docs: copy
Eric Bower  ·  2024-08-25
chore: doc comments
Eric Bower  ·  2024-08-19
chore(react): export `useStore` hook
Eric Bower  ·  2024-08-18
docs(loaders): meta code example
Eric Bower  ·  2024-08-18
docs(learn): preload then refresh
Eric Bower  ·  2024-08-16
docs: typo
Eric Bower  ·  2024-08-16
docs: copy
Eric Bower  ·  2024-08-16
docs: typo
Eric Bower  ·  2024-08-16
docs: copy
Eric Bower  ·  2024-08-16
docs: copy
Eric Bower  ·  2024-08-16
docs: copy
Eric Bower  ·  2024-08-16
docs: copy
Eric Bower  ·  2024-08-16
docs: copy
Eric Bower  ·  2024-08-16
docs: copy
Eric Bower  ·  2024-08-16
docs: copy
Eric Bower  ·  2024-08-16
docs: copy
Eric Bower  ·  2024-08-16
docs: more content
2a61af0
(v0.13.2)
Eric Bower  ·  2024-08-16
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  ·  2024-08-16
chore(thunk): use `console.warn` instead of `console.error`
14f1594
(v0.13.1)
Eric Bower  ·  2024-08-14
fix(thunk): remove unnecessary error log
Eric Bower  ·  2024-08-12
docs: exposition
Eric Bower  ·  2024-07-30
docs: readme
6ca0a85
(v0.13.0)
Eric Bower  ·  2024-07-30
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  ·  2024-07-30
docs(learn): headers
Eric Bower  ·  2024-07-30
docs: readme
Eric Bower  ·  2024-07-30
docs: learn page
Eric Bower  ·  2024-07-30
docs: content
Eric Bower  ·  2024-07-30
docs: logo
Eric Bower  ·  2024-07-26
chore: update pgs-action
Eric Bower  ·  2024-07-26
chore: update pgs-action
Eric Bower  ·  2024-07-09
docs: readme
Eric Bower  ·  2024-06-24
docs: effection link
Eric Bower  ·  2024-06-21
docs: copy
Eric Bower  ·  2024-06-21
refactor: pager partial
Eric Bower  ·  2024-06-21
style: tweak settings
Eric Bower  ·  2024-06-21
fix: sidebar links
Eric Bower  ·  2024-06-10
chore: nav
Eric Bower  ·  2024-06-10
chore: update deno.lock file
Eric Bower  ·  2024-06-10
docs: update pdocs and reframe lib
17b2c15
(v0.12.0)
Eric Bower  ·  2024-05-07
fix: catch error and bubble up
Eric Bower  ·  2024-04-19
chore: update deno.lock
f47ecce
(v0.11.0)
Eric Bower  ·  2024-04-15
fix(mdw): thunk loader needs `ctx.loader`
Eric Bower  ·  2024-03-19
docs: copy
Eric Bower  ·  2024-03-19
chore: update go
Eric Bower  ·  2024-03-19
chore: upgrade pgit
6313833
(v0.10.0)
Eric Bower  ·  2024-03-05
refactor: remove Result.data

BREAKING CHANGE: `ctx.json` no longer has a `.data` property
Eric Bower  ·  2024-03-05
docs: metadata
Eric Bower  ·  2024-03-05
docs: copy
Eric Bower  ·  2024-03-05
docs: soften the blow
Eric Bower  ·  2024-03-04
docs: getting started
Eric Bower  ·  2024-03-04
docs: getting started
9bc36df
(v0.9.0)
Eric Bower  ·  2024-03-04
fix: export ApiMdwProps
Eric Bower  ·  2024-03-04
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  ·  2024-03-04
docs: motivation
Eric Bower  ·  2024-03-03
design: sidebar
Eric Bower  ·  2024-03-01
docs: copy
Eric Bower  ·  2024-02-27
chore: retain 1 site
7ed8b3c
(v0.8.0)
Eric Bower  ·  2024-02-23
docs: clearTimers
Eric Bower  ·  2024-02-23
chore: make clearTimers more ergonomic (#42)

Eric Bower  ·  2024-02-23
feat: clear timers (#41)

feat: use `race` from `effection`

BREAKING CHANGE: replace `race` with `raceMap`
ed75824
(v0.7.2)
Eric Bower  ·  2024-02-23
chore: deprecate `slice.loader`

Use `slice.loaders` instead
072dd5b
(v0.7.1)
Eric Bower  ·  2024-02-22
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
Eric Bower  ·  2024-02-21
docs: cleanup
Eric Bower  ·  2024-02-18
chore: update pdocs
Eric Bower  ·  2024-02-16
chore: update pdocs
Eric Bower  ·  2024-02-16
docs: endpoints
Eric Bower  ·  2024-02-16
docs: copy
Eric Bower  ·  2024-02-16
docs: nav
Eric Bower  ·  2024-02-16
docs: copy
Eric Bower  ·  2024-02-16
json api example
Eric Bower  ·  2024-02-16
docs: sitemap links
Eric Bower  ·  2024-02-16
docs: react
Eric Bower  ·  2024-02-16
docs: react
Eric Bower  ·  2024-02-16
docs: copy
Eric Bower  ·  2024-02-15
docs: copy
Eric Bower  ·  2024-02-15
docs: typo
Eric Bower  ·  2024-02-15
docs: copy
Eric Bower  ·  2024-02-14
docs: api work
Eric Bower  ·  2024-02-14
docs: more pages
Eric Bower  ·  2024-02-14
fix: docs gha
Eric Bower  ·  2024-02-14
fix: docs gha
Eric Bower  ·  2024-02-14
fix: gha for docs
Eric Bower  ·  2024-02-14
fix: tweak gha
Eric Bower  ·  2024-02-14
docs site (#39)

95bee2f
(v0.7.0)
Eric Bower  ·  2024-02-10
Wait for loader (#37)

Eric Bower  ·  2024-02-08
docs: readme
e582179
(v0.6.0)
Eric Bower  ·  2024-02-07
chore: dont prefix action types

BREAKING CHANGE: we removed `@@starfx:` from all action types
6396f79
(v0.5.3)
Eric Bower  ·  2024-02-06
fix(ci): shell string
Eric Bower  ·  2024-02-05
fix: lint
Eric Bower  ·  2024-02-05
fix(thunk): `toString` must return `type` instead of `name`
Jacob Bolda  ·  2024-01-29
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
Eric Bower  ·  2024-01-22
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`
7fa2483
(v0.5.2)
Eric Bower  ·  2024-01-21
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.
98a9de7
(v0.5.1)
Eric Bower  ·  2024-01-19
chore: folder/file org cleanup (#33)

bcdad66
(v0.5.0)
Eric Bower  ·  2024-01-18
chore: update deno.lock
Eric Bower  ·  2024-01-18
refactor: rm redux (#32)

531fbae
(v0.4.1)
Eric Bower  ·  2024-01-11
refactor(query): better extract types from endpoints

- fix(query): pick correct `ApiError` type inside `createApi`
- `useCache` will automatically pull success type from endpoint.
f43c20f
(v0.4.0)
Eric Bower  ·  2024-01-10
refactor(store): export storeMdw as collection
Eric Bower  ·  2024-01-10
fix(store): loader mdw
Eric Bower  ·  2024-01-09
docs: readme
3baf359
(v0.3.11)
Eric Bower  ·  2024-01-08
fix(loader): consistent state shape
9775bca
(v0.3.10)
Eric Bower  ·  2024-01-08
fix(loader): dont save derived data inside slice
Eric Bower  ·  2024-01-05
feat(query): generic loader mdw
Eric Bower  ·  2024-01-05
chore(query): cleanup mdw.predicate
Eric Bower  ·  2024-01-05
feat(query): `mdw.predicate`
bb56c4c
(v0.3.9)
Eric Bower  ·  2024-01-03
fix: flatten PersistGate elements
064d6fe
(v0.3.8)
Eric Bower  ·  2024-01-03
fix(table): properly memoize `selectByIds`
Eric Bower  ·  2024-01-03
chore(query): export useCache type
Eric Bower  ·  2023-12-19
docs: readme
Eric Bower  ·  2023-12-19
docs: readme
Eric Bower  ·  2023-12-19
docs: readme
Eric Bower  ·  2023-12-18
docs: readme
Eric Bower  ·  2023-12-18
docs: readme
Eric Bower  ·  2023-12-18
docs: readme
Eric Bower  ·  2023-12-18
docs: readme
Eric Bower  ·  2023-12-18
docs: readme
Eric Bower  ·  2023-12-18
docs: readme
Eric Bower  ·  2023-12-18
docs: readme
Eric Bower  ·  2023-12-18
docs: readme
Eric Bower  ·  2023-12-18
docs: readme
fb0b016
(v0.3.7)
Eric Bower  ·  2023-12-18
feat(store): add local storage adapter
1e24f21
(v0.3.6)
Eric Bower  ·  2023-12-17
fix(thunks): types
be72c77
(v0.3.5)
Eric Bower  ·  2023-12-16
fix(store): persistor rehydrates properly now
Eric Bower  ·  2023-12-16
docs: readme
Eric Bower  ·  2023-12-16
docs: readme
7b1c7d5
(v0.3.4)
Eric Bower  ·  2023-12-15
fix(store): cache timer mdw
Eric Bower  ·  2023-12-15
chore: rename files and remove old fx
Eric Bower  ·  2023-12-15
chore: rm getframe
93fb0c8
(v0.3.3)
Eric Bower  ·  2023-12-14
refactor(log): generalize for any logging not just errors
7a9702e
(v0.3.2)
Eric Bower  ·  2023-12-14
fix(slice): properly memoize loader selectors
4ca821e
(v0.3.1)
Eric Bower  ·  2023-12-14
fix: wrong type for slice.any
Eric Bower  ·  2023-12-13
chore: remove `first` from upstream
8c23451
(v0.3.0)
Eric Bower  ·  2023-12-12
feat(store): `reset` updater to revert store to initialState provided by
user
Eric Bower  ·  2023-12-12
feat(slice.table): return empty value provided for reuse
Eric Bower  ·  2023-12-12
chore: remove outdated selectors
Eric Bower  ·  2023-12-12
docs: readme
Eric Bower  ·  2023-12-11
docs: readme
Eric Bower  ·  2023-12-11
docs: readme
Eric Bower  ·  2023-12-11
docs: readme
Eric Bower  ·  2023-12-11
docs: readme
cfcc818
(v0.2.2)
Eric Bower  ·  2023-12-04
fix: `slice.table` types
Eric Bower  ·  2023-12-03
docs: readme
Eric Bower  ·  2023-12-03
docs: readme
Eric Bower  ·  2023-12-03
docs: readme
Eric Bower  ·  2023-12-03
docs: readme
059dd3b
(v0.2.1)
Eric Bower  ·  2023-12-01
refactor(store): `slice.table` `empty` is now optional (#28)

Eric Bower  ·  2023-12-01
feat(query): thunk and api thunks can simply accept payload (#29)

8f49b0c
(v0.2.0)
Eric Bower  ·  2023-12-01
fix: export persist module
Eric Bower  ·  2023-12-01
fix(thunk): add `.use` to `CreateActionWithPayload` (#27)

Eric Bower  ·  2023-12-01
feat(store): redux-persist replacement (#21)

Eric Bower  ·  2023-12-01
feat: `createBatchMdw` for batching store listener events (#22)

Eric Bower  ·  2023-11-30
refactor: require data and loaders slices (#24)

Eric Bower  ·  2023-11-30
docs: readme
Eric Bower  ·  2023-11-30
docs: readme
b0613a8
(v0.1.0)
Eric Bower  ·  2023-11-30
chore: update effection@v3-beta.3
Eric Bower  ·  2023-11-30
feat: thunks dynamic mdw api (#26)

Eric Bower  ·  2023-11-30
docs: readme
Eric Bower  ·  2023-11-24
docs: readme
Eric Bower  ·  2023-11-23
docs: readme
Eric Bower  ·  2023-11-23
docs: readme
Eric Bower  ·  2023-11-22
docs: readme
Eric Bower  ·  2023-11-22
docs: readme
Eric Bower  ·  2023-11-22
docs: readme
Eric Bower  ·  2023-11-22
docs: readme
Eric Bower  ·  2023-11-22
docs: readme
Eric Bower  ·  2023-11-22
docs: readme
Eric Bower  ·  2023-11-22
docs: readme headers
Eric Bower  ·  2023-11-22
docs: readme
Eric Bower  ·  2023-11-22
refactor(query): middleware naming (#25)

Eric Bower  ·  2023-11-19
refactor(npm): use deno arg instead of env var
Eric Bower  ·  2023-11-19
doc: readme
Eric Bower  ·  2023-11-19
doc: readme
c6193ae
(v0.0.34)
Eric Bower  ·  2023-11-13
refactor(fx): use `call` from `effection` (#20)

Eric Bower  ·  2023-11-11
fix(gha): trailing slash rsync
Eric Bower  ·  2023-11-10
chore: use pgs-action
a4c160f
(v0.0.33)
Eric Bower  ·  2023-11-09
refactor(redux): custom queue impl (#19)

Eric Bower  ·  2023-11-01
chore(npm): explicit fields
2086bda
(v0.0.32)
Eric Bower  ·  2023-10-13
fix(redux): `poll` supervisor correct call sig
Eric Bower  ·  2023-10-13
chore: rm references to `saga-query`
307ecf0
(v0.0.31)
Eric Bower  ·  2023-10-13
chore: update `effection` to `beta.0`
Eric Bower  ·  2023-10-02
chore: update effection v3.0.15
4842df8
(v0.0.30)
Eric Bower  ·  2023-09-17
refactor(redux): take strat

Trying to think about performance considerations with implementation
0ba8393
(v0.0.28) (v0.0.29)
Eric Bower  ·  2023-09-16
refactor(redux): use signal for middleware
4d4f2d8
(v0.0.27)
Eric Bower  ·  2023-09-16
chore(redux): export `send` for debugging
30e8e88
(v0.0.26)
Eric Bower  ·  2023-09-16
refactor(redux): use signal instead of channel
9bffca8
(v0.0.25)
Eric Bower  ·  2023-09-16
fix(redux): dispatchActions needs batchActions
ed175e3
(v0.0.24)
Eric Bower  ·  2023-09-16
chore: type improvements
8b15e81
(v0.0.23)
Eric Bower  ·  2023-09-15
chore: modify supervisor types
5b3374e
(v0.0.22)
Eric Bower  ·  2023-09-15
chore: export more redux fns
e18a41f
(v0.0.21)
Eric Bower  ·  2023-09-15
chore: export supervisors
e0dffb4
(v0.0.20)
Eric Bower  ·  2023-09-15
chore: update deps

chore: update `saga-query` changes
Eric Bower  ·  2023-09-14
doc: update tagline
e1ff96d
(v0.0.19)
Vlad  ·  2023-09-12
refactor(store/slice): rename `obj.patch` to `obj.update`

3a918f0
(v0.0.18)
Eric Bower  ·  2023-09-09
fix: imports for `starfx/react`
f2722e4
(v0.0.17)
Eric Bower  ·  2023-09-09
Merge pull request #13 from neurosnap/create-table


---------

Co-authored-by: Vlad <vladmarginean@softwiz.ro>
Vlad  ·  2023-07-29
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  ·  2023-09-02
doc: readme
Eric Bower  ·  2023-09-02
doc: readme
Eric Bower  ·  2023-09-02
doc: readme
Eric Bower  ·  2023-09-02
doc: readme
Eric Bower  ·  2023-09-02
doc: readme update with references
Eric Bower  ·  2023-09-01
fix(pgs): retain
ec3aa69
(v0.0.16)
Eric Bower  ·  2023-08-28
Use redux (#12)

a8c1cbb
(v0.0.15)
Eric Bower  ·  2023-08-28
doc: refactor
Eric Bower  ·  2023-08-28
doc: readme
Eric Bower  ·  2023-08-28
Toolkit 2.0 (#11)

feat: added `prepareStore()`

BREAKING CHANGE: refactored `configureStore()` from `starfx/redux`
86db183
(v0.0.14)
Eric Bower  ·  2023-08-27
refactor: `call()` to not be safe (#9)

Eric Bower  ·  2023-08-23
docs: readme
Eric Bower  ·  2023-08-17
chore: add pgit
912155b
(v0.0.13)
Eric Bower  ·  2023-07-30
fix: bubble errors up properly
25ec8ea
(v0.0.12)
Eric Bower  ·  2023-07-30
fix: `errorHandler` properly catch errors
cdc5721
(v0.0.11)
Eric Bower  ·  2023-07-30
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)
6d5ec93
(v0.0.10)
Eric Bower  ·  2023-07-30
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);
});
```
3db088e
(v0.0.9)
Eric Bower  ·  2023-07-15
fix: dispatch type sig
Eric Bower  ·  2023-07-14
docs: readme
Eric Bower  ·  2023-07-14
chore: fix readme fmt
Eric Bower  ·  2023-07-14
docs: quick readme example
a57267b
(v0.0.8)
Eric Bower  ·  2023-07-14
refactor: switch default createPipe() supervisor to redux
Eric Bower  ·  2023-07-14
feat: immutable store (#2)

b8d1fd5
(v0.0.7)
Eric Bower  ·  2023-07-10
fmt
0cf7617
(v0.0.6)
Eric Bower  ·  2023-07-10
fix: npm release
7629481
(v0.0.5)
Vlad  ·  2023-07-10
add enhancers to redux store (#3)

Eric Bower  ·  2023-07-10
fix: double take on same event (#4)

Eric Bower  ·  2023-05-27
fix(npm): generate esm-specific types
Eric Bower  ·  2023-05-22
chore: use mod.ts for entry points
0b71265
(v0.0.4)
Eric Bower  ·  2023-05-21
chore: npm build tweaks
Eric Bower  ·  2023-05-21
chore: npm working!
Eric Bower  ·  2023-05-21
chore: move examples
Eric Bower  ·  2023-05-21
chore: more natural npm imports
Eric Bower  ·  2023-05-21
chore: reorg files and types
Eric Bower  ·  2023-05-21
chore: refactor redux store creator
Eric Bower  ·  2023-05-21
chore: compose types
119d312
(v0.0.3)
Eric Bower  ·  2023-05-20
fix: publish workflow
02f69d6
(v0.0.2)
Eric Bower  ·  2023-05-20
fix: missing lock
Eric Bower  ·  2023-05-20
fix: npm build
bc68e89
(v0.0.1)
Eric Bower  ·  2023-05-20
chore: fmt
Eric Bower  ·  2023-05-20
doc: readme
Eric Bower  ·  2023-05-20
doc: readme
Eric Bower  ·  2023-05-20
doc: description
Eric Bower  ·  2023-05-20
feat(query): Data synchronization using a middleware system for front-end apps (#1)

Eric Bower  ·  2023-04-24
chore: update deno lock
Eric Bower  ·  2023-04-20
take helpers
Eric Bower  ·  2023-04-20
tweaks
Eric Bower  ·  2023-04-20
feat: `compose` function for middleware
Eric Bower  ·  2023-04-19
refactor: `call` returns `Result` now
Eric Bower  ·  2023-04-19
chore: moved `once`
Eric Bower  ·  2023-04-19
chore: fix imports
Eric Bower  ·  2023-04-19
chore: remove .bak file
Eric Bower  ·  2023-04-19
chore(fx): replaced `all` with `parallel`
Eric Bower  ·  2023-04-17
feat: parallel fx
Eric Bower  ·  2023-04-16
parallel api
Eric Bower  ·  2023-04-15
fix
Eric Bower  ·  2023-04-15
explicit exports
Eric Bower  ·  2023-04-15
lock
Eric Bower  ·  2023-04-03
docs: readme
Eric Bower  ·  2023-04-03
docs: fix linter
Eric Bower  ·  2023-04-03
docs: readme
Eric Bower  ·  2023-03-27
chore: getting ready for initial release
Eric Bower  ·  2023-03-27
init