Releases: vigetlabs/microcosm
Releases · vigetlabs/microcosm
v12.10.0
- Microcosm ships with ES6 and UMD bundles
- Domains and Effects can implement a
defaults
static object to
provide default setup options. - Do not return undefined when using
get
to retrieve a null value
without a fallback. repo.append(action, state)
should reconcile history
Version 12.9.0
- Added new
repo.parallel
method. This returns an action that represents a group of actions processing in parallel. - The action generator form may now
yeild
an array. This produces the same behavior asrepo.parallel
Presenter::getModel
assignments accept Observables.- Do not warn in strict mode when attempting to change a complete action. This allows for use cases like, "Cancel this action, but only if it hasn't finished yet."
- History and Action now serialize to JSON. This supports a new debugger.
Presenter:send
now pushes to the instance of Microcosm for the Presenter that first sent the action. This preventsrepo.state
from being wrong for a subsection of an application with an action that needs to reference state.- Microcosm uses Flow. Flow definitions ship with the npm module.
v12.9.0-beta4: 12.9.0 Beta 4
Fixes an issue where multiple domain handler dispatches would incorrectly apply new state.
v12.9.0-beta3: 12.9.0 Beta 3
- Add debug mode for devtools integration - Fix case where nested presenters were called with the wrong scope
v12.9.0-beta2: 12.9.0 Beta 2
- Correctly invoke Presenter intercept handler with the Presenter as context.
v12.9.0-beta: 12.9.0 (beta)
- Added new `repo.parallel` method. This returns an action that represents a group of actions processing in parallel. - The action generator form may now `yeild` an array. This produces the same behavior as `repo.parallel` - `Presenter::getModel` assignments accept [Observables](https://github.com/tc39/proposal-observable). - Do not warn in strict mode when attempting to change a complete action. This allows for use cases like, "Cancel this action, but only if it hasn't finished yet." - History and Action now serialize to JSON. This supports a new [debugger](https://github.com/vigetlabs/microcosm-devtools). - `Presenter:send` now pushes to the instance of Microcosm for the Presenter that first sent the action. This prevents `repo.state` from being wrong for a subsection of an application with an action that needs to reference state. - Microcosm uses [Flow](flowtype.org). Flow definitions ship with the npm module.
v12.9.0-alpha: 12.9.0 Alpha
- Added new `repo.parallel` method. This returns an action that represents a group of actions processing in parallel. - The action generator form may now `yeild` an array. This produces the same behavior as `repo.parallel` - `Presenter::getModel` assignments accept [Observables](https://github.com/tc39/proposal-observable). - Do not warn in strict mode when attempting to change a complete action. This allows for use cases like, "Cancel this action, but only if it hasn't finished yet." - History and Action now serialize to JSON. This supports a new [debugger](https://github.com/vigetlabs/microcosm-devtools).
v12.8.0
Version 12.7.0
- Remove PropType usage from addons to prevent React 15.5.x deprecation warnings.
- Added configurable
teardown
method to the Microcosm prototype. This behaves similarly toteardown
methods on other Microcosm classes. - Fixed a bug where the first action dispatched would always fire a change event, even if state didn't change.
- The first argument of
repo.push
is passed into theopen
state of actions that return promises. - Action status changing methods are auto-bound, and will warn when a completed action attempts to move into a new state (strict mode only)
- Added
batch
as an option when instantiating Microcosm. When set totrue
, high frequency change events will be batched together usingrequestIdleCallback
. When not available, it falls back to setTimeout.
Auto-bound action status methods
Action status methods like action.resolve()
and action.reject()
are auto-bound. They can be passed directly into a callback without needing to wrap them in an anonymous function.
This is particularly useful when working with AJAX libraries. For example, when working with superagent
:
Instead of:
import superagent from 'superagent'
function getPlanets () {
return action => {
let request = superagent.get('/planets')
request.on('request', (data) => action.open(data))
request.on('progress', (data) => action.update(data))
request.on('abort', (data) => action.cancel(data))
request.then((data) => action.resolve(data), (error) => action.reject(error))
}
}
You can do:
import superagent from 'superagent'
function getPlanets () {
return action => {
let request = superagent.get('/planets')
request.on('request', action.open)
request.on('progress', action.update)
request.on('abort', action.cancel)
request.then(action.resolve, action.reject)
}
}
12.7.0 Beta
12.7.0-beta
- Remove PropType usage from addons to prevent React 15.5.x deprecation warnings.
- Added configurable
teardown
method to the Microcosm prototype. This behaves similarly toteardown
methods on other Microcosm classes. - Fixed a bug where the first action dispatched would always fire a change event, even if state didn't change.
- The first argument of
repo.push
is passed into theopen
state of actions that return promises. - Action status changing methods are auto-bound, and will warn when a completed action attempts to move into a new state (strict mode only)
- Added
batch
as an option when instantiating Microcosm. When set totrue
, high frequency change events will be batched together usingrequestIdleCallback
. When not available, it falls back to setTimeout.