Version 8.0.0
Noticeable changes
- Stores now contain the logic for how it should receive an action.
logic is contained undersend. - Stores now contain the logic to determine what method should resolve
an action sent to it. This is defined inregister Microcosm::deserializewill now only operate on the keys provided
by the seed object. This means that data passed intoreplace
will only blow way keys provided in the data object.- The signaling logic for dispatching actions will throw an error if
the action provided is not a function - Internalized tag, it will now lazy evaluate as actions are fired
- Upgraded Foliage, Microcosm now contains
subscribe,unsubscribe, andpublishaliases forlisten,ignore, andpublish
Breaking Changes
- Remove all uses of the
tagmodule.
Changes to Stores
Before this release, stores would listen to actions using the stringified value of their functions:
var MyStore = {
[Action.add](state, params){}
}This was terse, however required actions to be tagged with a special helper method. It also required any module that needed access to a Store's method to also know what actions it implemented.
To address these concerns, Stores now communicate with a Microcosm using the register method:
var MyStore = {
register() {
return {
[Action.add]: this.add
}
},
add(state, params){}
}Under the hood, Microcosm tags functions automatically.