microcosm
Advanced tools
Comparing version 7.1.1 to 8.0.0-alpha
@@ -8,3 +8,3 @@ # API Cheatsheet | ||
+--------------+ | ||
start - Resets initial state, installs all plugins, and then executes a callback | ||
start - Calls reset(), installs all plugins, and then executes a callback | ||
@@ -15,5 +15,9 @@ State Management | ||
push - Queue up an action, potentially changing data | ||
prepare - Partially apply the `push` method | ||
replace - Replace state with the result of deserializing a set of data | ||
reset - Replace state with the result of calling `getInitialState` | ||
Life Cycle | ||
+--------------+ | ||
getInitialState - Reduces the result of calling `getInitialState` on all stores | ||
Serialization | ||
@@ -20,0 +24,0 @@ +--------------+ |
@@ -0,11 +1,31 @@ | ||
# Design | ||
Without getting too lofty, this is roughly the ideal scenario for a | ||
Microcosm: | ||
``` | ||
|--> [Store] ---| | ||
[app.push] ------> [Action] ------> [Dispatcher] ---+--> [Store] ---+--> [app.shouldUpdate?] | ||
^ |--> [Store] ---| | | ||
| | | ||
| v | ||
[External Services] <--------------------------------------------------------- [YES] | ||
|-→ [Store] -| | ||
[app.send] ---→ [Action] ---→ [app.dispatch] -+-→ [Store] -+-→ [update?] | ||
↑ |-→ [Store] -| | | ||
| | | ||
| ↓ | ||
[Plugins] ←---------------------------------------------------- [change] | ||
|- User Interface | ||
|- Router | ||
|- Firebase sync | ||
↑ | ||
[app.start] | ||
``` | ||
1. **Initialize**. Performed by `app.start()`. This gathers initial state | ||
from stores and boots plugins. | ||
2. **Fire Action**. Performed by `app.send(action, params)`. Pushes an | ||
action into the queue. If it succeeds, dispatch it to the stores. | ||
3. **Store reconciliation**. Each store that is registered to respond | ||
to the action returns a new state by operating on a given old state | ||
within the context of parameters sent by the action. | ||
4. **Change reconciliation**. If any changes to the data model | ||
occurred, a change event is fired. Plugins can listen to this | ||
change to perform operations. These might include rendering a new | ||
UI, persisting application state in `localStorage`, etc. | ||
5. **Repeat steps 2-4** |
{ | ||
"name": "microcosm", | ||
"version": "7.1.1", | ||
"description": "A functional flux architecture", | ||
"main": "index.js", | ||
"version": "8.0.0-alpha", | ||
"description": "A variant of Facebook's Flux with centralized, isolated state", | ||
"main": "src/Microcosm.js", | ||
"repository": { | ||
@@ -10,7 +10,10 @@ "type": "git", | ||
}, | ||
"keywords": [ | ||
"react", | ||
"flux" | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"diode": "^4.0.0", | ||
"foliage": "^0.16.0" | ||
"diode": "~4.0" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
110927
1
21
239
2
79
1
+ Addeddiode@4.0.0(transitive)
- Removedfoliage@^0.16.0
- Removeddiode@4.4.0(transitive)
- Removedfoliage@0.16.0(transitive)
- Removedkarma-cli@0.0.4(transitive)
- Removedresolve@0.5.1(transitive)
Updateddiode@~4.0