New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

microcosm

Package Overview
Dependencies
Maintainers
1
Versions
233
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

microcosm - npm Package Compare versions

Comparing version 7.1.1 to 8.0.0-alpha

docs/api/actions.md

8

docs/cheatsheet.md

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc