microcosm
Advanced tools
Changelog
6.1.0
Microcosm::pull
can now accept an array of keys for the first
argument. This will traverse the nested keys of state to calculate value.Changelog
6.0.0
6.0.0 is the second effort to reduce the surface area of the Microcosm API.
Upstream
and Downstream
mixins. They used the
undocumented context API and introduced some complexity in testingMicrocosm::send
is now Microcosm::push
Microcosm::push
is now Microcosm::replace
Microcosm::dispatch
and Microcosm::commit
are now private. These
are important methods that should not be overriddenChangelog
5.2.0
Microcosm::pull
accepts a callback that allows you to modify the
result. This should help to make data queries more terse.Microcosm::clone
, the functionality is not gone, but it
has been internalized to mitigate the cost of future changesChangelog
5.1.0
Microcosm::pull
which returns all stateUpstream
and Downstream
mixin, however it is
experimental. More details will come as the feature develops.Microcosm::send
will throw an error if given an undefined
action parameterChangelog
5.0.0
Version 5 represents an attempt to address some growth pains from rapidly adding new features to Microcosm. Names have been changed to improve consistency and internal APIs have been refactored. The overall surface area of the app has been reduced and more opinions have been made.
Microcosm::seed
to Microcosm::push
Microcosm::get
to Microcosm::pull
Microcosm::has
Microcosm::getInitialState
. the Store
API still provides
this function, however it is the expectation of the system that
value of state is a primitive object. This is so that Microcosm
always knows how to smartly clone its state, regardless of if
another data library is used for its values.Microcosm::swap
, this was an internal API that is no
longer requiredMicrocosm::reset
to Microcosm::commit
Microcosm::shouldUpdate
. If no stores respond to an
action, a change event will not fire anyway. Placing this concern in
the view layer keeps React's shouldComponentUpdate
as the single
responsibility for this task.Microcosm::toObject
mapBy
has been renamed to remap
. It now
operates primarily upon objects.Microcosm::pump
is now Microcosm::emit
, this is to better match
existing event emitter libraries (including the one in Node's
standard library)As an additional illustration, the Microcosm API has been logistically
sorted within ./cheatsheet.md
Changelog
4.0.0
Microcosm::start
. Calling start()
will bootstrap initial
state, run all plugins, then execute a callback.Changelog
3.3.0
mapBy
internal function now accepts an initial valueMicrocosm::dispatch
copy strategy. Instead of merging a
change set, it now directly modifies a clone of the previous
state.Microcosm::clone
. This method defines how state is copied
before dispatching an action.