microcosm
Advanced tools
Changelog
8.1.0
this
from register()
by default. This is
a potentially breaking change, however should not pose a problem to
projects using idiomatic Store registration.tag
now includes the name of the function in toString()
Changelog
8.0.0
send
.register
Microcosm::deserialize
will now only operate on the keys provided
by the seed object. This means that data passed into replace
will only blow way keys provided in the data object.subscribe
, unsubscribe
, and publish
aliases for listen
, ignore
, and publish
tag
module.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.