repos / starfx

supercharged async flow control library.
git clone https://github.com/neurosnap/starfx.git

commit
3f5d0aa
parent
60440e9
author
Eric Bower
date
2023-12-19 01:21:39 +0000 UTC
docs: readme
1 files changed,  +7, -8
M README.md
+7, -8
 1@@ -124,7 +124,7 @@ up a `redux` store is work, but that is in an effort to serve its
 2 maintainability.
 3 
 4 Having said that, the core abstraction in `redux` is a reducer. Reducers were
 5-originally designed to contain isolated business logic of updating sections of
 6+originally designed to contain isolated business logic for updating sections of
 7 state (also known as state slices). They were also designed to make it easier to
 8 sustain state immutability.
 9 
10@@ -138,20 +138,19 @@ a single function that updates X state slices, we have X functions (reducers)
11 that we need to piece together in our heads to understand what is being updated
12 when an action is dispatched.
13 
14-Therefore, reducers are not great containers for business logic. They are rigid
15-and require the end-developer to piece them together in their head to fully
16-understand the ramifications of dispatching an action.
17-
18 With all of this in mind, `starfx/store` takes all the good parts of `redux` and
19 removes the need for reducers entirely. We still have a single state object that
20-contains everything from data fetched from an API, UX, and a way to create
21-memoized functions (e.g. selectors). We maintain immutability (using `immer`)
22-and also have a middleware system to extend it.
23+contains everything from API data, UX, and a way to create memoized functions
24+(e.g. selectors). We maintain immutability (using `immer`) and also have a
25+middleware system to extend it.
26 
27 Finally, we bring the utility of creating a schema (like `zod` or a traditional
28 database) to make it plainly obvious what the state shape looks like as well as
29 reusable utilities to make it easy to update and query state.
30 
31+This gets us closer to treating our store like a traditional database while
32+still being flexible for our needs on the FE.
33+
34 ```ts
35 import { configureStore, createSchema, select, slice } from "starfx/store";
36