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

microcosm

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

microcosm - npm Package Compare versions

Comparing version 12.9.0-alpha to 12.9.0-beta

@@ -60,2 +60,5 @@ 'use strict';

/* istanbul ignore next */
var identity = function identity() {};
var ActionButton = function (_React$PureComponent) {

@@ -89,3 +92,3 @@ inherits(ActionButton, _React$PureComponent);

ActionButton.prototype.render = function render() {
var props = ___microcosm_js.merge({}, this.props, { onClick: this.click });
var props = ___microcosm_js.merge(this.props, { onClick: this.click });

@@ -113,3 +116,3 @@ delete props.tag;

ActionButton.contextTypes = {
send: function send() {}
send: identity
};

@@ -116,0 +119,0 @@ ActionButton.defaultProps = {

@@ -61,2 +61,5 @@ 'use strict';

/* istanbul ignore next */
var identity = function identity() {};
var ActionForm = function (_React$PureComponent) {

@@ -76,6 +79,6 @@ inherits(ActionForm, _React$PureComponent);

ActionForm.prototype.render = function render() {
var props = ___microcosm_js.merge({}, this.props, { ref: 'form', onSubmit: this.onSubmit });
var props = ___microcosm_js.merge(this.props, { ref: 'form', onSubmit: this.onSubmit }
// Remove invalid props to prevent React warnings
delete props.action;
);delete props.action;
delete props.prepare;

@@ -114,3 +117,3 @@ delete props.serializer;

ActionForm.contextTypes = {
send: function send() {}
send: identity
};

@@ -117,0 +120,0 @@ ActionForm.defaultProps = {

@@ -12,3 +12,2 @@ 'use strict';

* Shallow copy an object
* @private
*/

@@ -19,3 +18,2 @@

* Merge any number of objects into a provided object.
* @private
*/

@@ -25,13 +23,19 @@

/**
* Basic prototypal inheritence
* @private
* Retrieve a value from an object. If no key is provided, just return
* the object.
*/
function get$1(object, keyPath, fallback) {
var path = castPath(keyPath);
var value = object;
for (var i = 0, len = path.length; i < len; i++) {
if (value == null) {
break;
}
/**
* Retrieve a value from an object. If no key is provided, just return the
* object.
* @private
*/
value = value[path[i]];
}
return value == null ? fallback : value;
}

@@ -41,3 +45,2 @@ /**

* value is the same, don't do anything. Otherwise return a new object.
* @private
*/

@@ -48,5 +51,2 @@

* Is the provided object a promise?
* @param {*} obj
* @return {boolean}
* @private
*/

@@ -57,5 +57,2 @@

* Is a value an object?
* @param {*} target
* @return {boolean}
* @private
*/

@@ -66,32 +63,24 @@

* Is a value a function?
* @param {*} target
* @return {boolean}
* @private
*/
function isBlank(value) {
return value === '' || value === null || value === undefined;
}
/**
* Is a value a string?
* @param {*} target
* @return {boolean}
* @private
* Get the toStringTag symbol out of an object, with
* some legacy support.
*/
function isString(target) {
return typeof target === 'string';
}
/* istanbul ignore next */
var $Symbol = typeof Symbol === 'function' ? Symbol : {};
var toStringTagSymbol = get$1($Symbol, 'toStringTag', '@@toStringTag');
/**
* Is the provided value a generator function? This is largely
* informed by the regenerator runtime.
* @param {*} value
* @return {boolean}
* @private
*/
/**
* @private
*/

@@ -101,13 +90,10 @@

* A helper combination of get and set
* @param {Object} state
* @param {Array.<string>|string} keyPath
* @param {*} updater A function or static value
* @param {*} fallback value
* @private
*/
/**
* A key path is a list of property names that describe a pathway
* through a nested javascript object. For example, `['users', 2]`
* could represent a path within in `{ users: [{id: 0}, {id: 1}] }`
* @fileoverview A key path is a list of property names that describe
* a pathway through a nested javascript object. For example,
* `['users', 2]` could represent a path within in `{ users: [{id: 0},
* {id: 1}] }`
*
*/

@@ -118,10 +104,4 @@

function isBlank(value) {
return value === '' || value === null || value === undefined;
}
/**
* Ensure a value is a valid key path.
* @param {*} value Value to convert into a key path
* @return {Array} List of keys, like ['users', 2]
* @private

@@ -136,3 +116,3 @@ */

return isString(value) ? value.trim().split(KEY_DELIMETER) : [value];
return typeof value === 'string' ? value.trim().split(KEY_DELIMETER) : [value];
}

@@ -144,14 +124,10 @@

* subscription to multiple pathways in an object.
* @param {String|String[]} value Comma separated string or array
* @return {Array} List of paths, like [['users'], ['query', 'focus']]
* @private
*/
function getKeyPaths(value) {
var paths = value;
if (Array.isArray(value) === false) {
paths = ('' + paths).split(PATH_DELIMETER);
if (typeof value === 'string') {
return ('' + value).split(PATH_DELIMETER).map(castPath);
}
return paths.map(castPath);
return value.every(Array.isArray) ? value : value.map(castPath);
}

@@ -161,4 +137,2 @@

* Convert a key path into a string.
* @param {String[]} value List of keys, like ['query', 'focus']
* @return {String} Dot separated string, like 'query.focus'
* @private

@@ -170,4 +144,2 @@ */

* Convert a list of keys path into a string.
* @param {Array} array List of key paths, like [['users'], ['query', 'focus']]
* @return {Array} Comma key paths, like 'users,query.focus'
* @private

@@ -174,0 +146,0 @@ */

@@ -60,2 +60,3 @@ 'use strict';

* getModel function.
*
*/

@@ -82,6 +83,2 @@

/**
* @param {Microcosm} repo Track this Microcosm instance for updates
* @param {scope} scope Scope to invoke functional bindings
*/
function Model(repo, scope) {

@@ -104,4 +101,2 @@ classCallCheck(this, Model);

* Track an observable. Sending updates to a given key.
* @param {string} key
* @param {Observable} observable
*/

@@ -125,7 +120,2 @@

/**
* @param {Object} bindings A set of key/value pairs for building a model
*/
Model.prototype.bind = function bind(bindings) {

@@ -149,4 +139,2 @@ this.bindings = {};

* Update a specific model key. Emits a change event
* @param {string} key
* @param {*} value
*/

@@ -153,0 +141,0 @@

@@ -64,2 +64,3 @@ 'use strict';

* getModel function.
*
*/

@@ -86,6 +87,2 @@

/**
* @param {Microcosm} repo Track this Microcosm instance for updates
* @param {scope} scope Scope to invoke functional bindings
*/
function Model(repo, scope) {

@@ -108,4 +105,2 @@ classCallCheck(this, Model);

* Track an observable. Sending updates to a given key.
* @param {string} key
* @param {Observable} observable
*/

@@ -129,7 +124,2 @@

/**
* @param {Object} bindings A set of key/value pairs for building a model
*/
Model.prototype.bind = function bind(bindings) {

@@ -153,4 +143,2 @@ this.bindings = {};

* Update a specific model key. Emits a change event
* @param {string} key
* @param {*} value
*/

@@ -214,2 +202,3 @@

* manage application flow.
*
*/

@@ -221,9 +210,5 @@

/* istanbul ignore next */
var identity = function identity() {};
/**
* @class
* @extends React.PureComponent
*/
var Presenter = function (_React$PureComponent) {

@@ -266,3 +251,3 @@ inherits(Presenter, _React$PureComponent);

var givenRepo = this.props.repo || contextRepo;
var workingRepo = this.getRepo(givenRepo, this.props, this.state);
var workingRepo = this.getRepo(givenRepo, this.props);

@@ -277,5 +262,2 @@ this.didFork = workingRepo !== givenRepo;

* runs before the first `getModel` invocation.
* @param {Microcosm} repo
* @param {Object} props
* @param {Object} state
*/

@@ -292,5 +274,2 @@

* other start tasks that need access to the model data.
* @param {Microcosm} repo
* @param {Object} props
* @param {Object} state
*/

@@ -307,5 +286,2 @@ ;

* new information.
* @param {Microcosm} repo
* @param {Object} nextProps
* @param {Object} nextState
*/

@@ -321,5 +297,2 @@ ;

* subscriptions and other setup behavior.
* @param {Microcosm} repo
* @param {Object} props
* @param {Object} state
*/

@@ -358,4 +331,2 @@ ;

* Presenter forking behavior:
* @param {Microcosm} repo
* @param {Object} props
*/

@@ -376,11 +347,13 @@

* component.
* @param {Function|string} action
* @param {...*} params
*/
Presenter.prototype.send = function send() {
Presenter.prototype.send = function send(command) {
var _mediator;
return (_mediator = this.mediator).send.apply(_mediator, arguments);
for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
params[_key - 1] = arguments[_key];
}
return (_mediator = this.mediator).send.apply(_mediator, [command].concat(params));
};

@@ -391,4 +364,2 @@

* return an object of key/value pairs.
* @param {Object} presenterProps
* @param {Object} presenterState
*/

@@ -429,3 +400,3 @@

_this2.model.on('change', _this2.setState, _this2);
_this2.model.on('change', _this2.updateState, _this2);
return _this2;

@@ -437,3 +408,4 @@ }

repo: this.repo,
send: this.send
send: this.send,
parent: this
};

@@ -463,3 +435,3 @@ };

PresenterMediator.prototype.render = function render() {
// setState might have been called before the model
// setObject might have been called before the model
// can get assigned

@@ -478,2 +450,6 @@ this.presenter.model = this.state;

PresenterMediator.prototype.updateState = function updateState(state) {
this.setState(state);
};
PresenterMediator.prototype.updateModel = function updateModel(props, state) {

@@ -487,33 +463,35 @@ var bindings = this.presenter.getModel(props, state);

PresenterMediator.prototype.hasParent = function hasParent() {
// Do not allow transfer across repos. Check to for inheritence by comparing
// the common history object shared between repos
return Microcosm.get(this.repo, 'history') === Microcosm.get(this.context, ['repo', 'history']);
PresenterMediator.prototype.getParent = function getParent() {
return this.context.parent;
};
PresenterMediator.prototype.getHandler = function getHandler(intent) {
var interceptors = this.presenter.intercept
// A presenter's register goes through the same registration steps
();return Microcosm.getRegistration(interceptors, intent, 'resolve');
};
PresenterMediator.prototype.send = function send(intent) {
for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
params[_key - 1] = arguments[_key];
var _repo;
for (var _len2 = arguments.length, params = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
params[_key2 - 1] = arguments[_key2];
}
// tag intent first so the interceptor keys off the right key
var taggedIntent = Microcosm.tag(intent);
var mediator = this;
var interceptors = this.presenter.intercept();
while (mediator) {
var handler = mediator.getHandler(taggedIntent);
// A presenter's register goes through the same registration steps
var handler = Microcosm.getRegistration(interceptors, taggedIntent, 'resolve');
if (handler) {
return handler.call.apply(handler, [mediator, mediator.repo].concat(params));
}
// Does the presenter register to this intent?
if (handler) {
return handler.call.apply(handler, [this.presenter, this.repo].concat(params));
mediator = mediator.getParent();
}
// No: try the parent presenter
if (this.hasParent()) {
return this.context.send.apply(null, arguments);
}
// If we hit the top, push the intent into the Microcosm instance
return this.repo.push.apply(this.repo, arguments);
return (_repo = this.repo).push.apply(_repo, arguments);
};

@@ -526,9 +504,11 @@

repo: identity,
send: identity
send: identity,
parent: identity
};
PresenterMediator.childContextTypes = {
repo: identity,
send: identity
send: identity,
parent: identity
};
exports['default'] = Presenter;

@@ -10,2 +10,3 @@ 'use strict';

* Connect a component to the presenter tree
*
*/

@@ -12,0 +13,0 @@

# Changelog
## 12.9.0 Alpha
# 12.9.0 (beta)

@@ -11,3 +11,3 @@ - Added new `repo.parallel` method. This returns an action that

accept [Observables](https://github.com/tc39/proposal-observable).
- Do not warn in strict mode when attempting to change a complete
- Do not warn in strict mode when attempting to change a complete
action. This allows for use cases like, "Cancel this action, but

@@ -17,2 +17,8 @@ only if it hasn't finished yet."

[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.

@@ -19,0 +25,0 @@ ## 12.8.0

@@ -39,3 +39,3 @@ # ActionButton

class CountPresenter extends Presenter {
model () {
getModel () {
return {

@@ -46,3 +46,3 @@ count : state => state.count

view ({ count }) {
render ({ count }) {
return (

@@ -49,0 +49,0 @@ <ActionButton action={increaseCount} value={1}>

@@ -131,3 +131,3 @@ # Domains

### `setup()`
### `setup(repo, options)`

@@ -137,6 +137,7 @@ Setup runs right after a domain is added to a Microcosm, but before it runs

### `teardown()`
### `teardown(repo)`
Runs whenever `Microcosm::teardown` is invoked. Useful for cleaning up
work done in `setup()`.
Runs whenever a Microcosm is torn down. This usually happens when a
Presenter component unmounts. Useful for cleaning up work done in
`setup()`.

@@ -143,0 +144,0 @@ ### `serialize(staged)`

@@ -186,3 +186,3 @@ # Effects

Returns an object mapping actions to methods on the effect. This is the
communication point between a effect and the rest of the system.
communication point between a effect and the rest of the system.

@@ -189,0 +189,0 @@ ```javascript

@@ -61,6 +61,9 @@ # Immutability Helpers

// Or an array of keys to access a deeply nested value
// An array of keys to access a deeply nested value
let earth = get(state, ['planets', 'earth'])
console.log(earth) // { color: 'blue' }
// Or a string keypath can also be used to access a deeply nested value
let earth = get(state, 'planets.earth')
// If a value isn't found

@@ -98,6 +101,10 @@ let color = get(state, ['planets', 'venus', 'color'])

// Or an array of keys to deeply assign a value
// An array of keys to deeply assign a value
let next = set(state, ['planets', 'venus'], { color: 'yellow' })
console.log(state) // { planets: { venus, earth, mars } }
// Or a string keypath can be used to deeply assign a value
let next = set(state, 'planet.venus', {color: 'yellow' })
console.log(state) // { planets: { venus, earth, mars } }
// If the value is the same, no change will occur

@@ -116,6 +123,21 @@ let next = set(state, ['planets', 'earth', 'color'], blue)

let votes = { yay: 0, nay: 0 }
let next = update(votes, 'yay', n => n + 1)
let state = {
population = 7500000000
planets: {
earth: { mass: 1 },
mercury: { mass: 0.055 },
jupiter: { mass: 316 },
}
}
console.log(next) // { yay: 1, nay: 0 }
// Pass a simple string key
let next = update(state, 'population', n => n + 1)
// An array of keys to update a deeply nested value
let next = update(state, ['planets', 'jupiter', 'mass'], n => n + 1)
// Or a string keypath can be used to do deeply nested updates
let next = update(state, 'planets.jupiter.mass', n => n + 1)
console.log(next.population) // 7500000001
```

@@ -122,0 +144,0 @@

@@ -379,3 +379,3 @@ # Presenter

return (
<button onClick=() => send('alert', message)>
<button onClick={() => send('alert', message)}>
Click Me

@@ -382,0 +382,0 @@ </button>

@@ -7,45 +7,44 @@ # React Router Integration

The `Presenter` addon can be used to "frame" an app with a given
Microcosm in context:
We recommend mounting a "root" `Presenter`, framing context such that
child presenters have access to a central Microcosm repo:
```javascript
import React from 'react'
import DOM from 'react-dom'
import Presenter from 'microcosm/addons/presenter'
import Microcosm from 'microcosm'
import routes from './routes'
import React from 'react'
import DOM from 'react-dom'
import { Router } from 'react-router'
import createBrowserHistory from 'history/createBrowserHistory'
import { AppContainer } from 'react-hot-loader'
import Application from './views/layout'
import { Router, browserHistory } from 'react-router'
const repo = new Microocsm()
const repo = new Microcosm()
DOM.render((
<Presenter repo={ repo }>
<Router history={ browserHistory } routes={ routes } />
</Presenter>
), document.getElementById('entry-point'))
DOM.render(
<Router>
<Application repo={repo} />
</Router>,
document.getElementById('app')
)
```
`Presenter` accepts an instance of Microcosm, exposing it via
`context`. From there, other presenters can lean on that context to
add specific data subscriptions:
Drawing from the example above, `Application` may look something like:
```javascript
import React from 'react'
import Switch from 'react-router/Switch'
import Route from 'react-router/Route'
import Presenter from 'microcosm/addons/presenter'
class Planets extends Presenter {
viewModel() {
return {
planets: state => state.planets
}
}
class Application extends Presenter {
render() {
return (
<ul>
{ this.state.planets.map(planet => (<li>{ planet.name }</li>)) }
</ul>
<Switch>
{ /* routes */ }
</Switch>
)
}
}
export default Application
```
For more information, see the [React Router example app](https://github.com/vigetlabs/microcosm/tree/master/examples/react-router).

@@ -1,1 +0,1 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),n=require("../microcosm.js"),o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},r=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},p=function(e){function p(t,n){o(this,p);var r=i(this,e.call(this,t,n));return r.send=r.props.send||r.context.send,r.click=r.click.bind(r),r}return r(p,e),p.prototype.click=function(e){var t=this.send(this.props.action,this.props.value);return t&&t instanceof n.Action&&t.onOpen(this.props.onOpen).onUpdate(this.props.onUpdate).onCancel(this.props.onCancel).onDone(this.props.onDone).onError(this.props.onError),this.props.onClick&&this.props.onClick(e,t),t},p.prototype.render=function(){var e=n.merge({},this.props,{onClick:this.click});return delete e.tag,delete e.action,delete e.value,delete e.onOpen,delete e.onDone,delete e.onUpdate,delete e.onCancel,delete e.onError,delete e.send,"button"===this.props.tag&&null==e.type&&(e.type="button"),t.createElement(this.props.tag,e)},p}(t.PureComponent);p.contextTypes={send:function(){}},p.defaultProps={tag:"button"},exports.default=p;
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),n=require("../microcosm.js"),o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},r=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},p=function(){},s=function(e){function p(t,n){o(this,p);var r=i(this,e.call(this,t,n));return r.send=r.props.send||r.context.send,r.click=r.click.bind(r),r}return r(p,e),p.prototype.click=function(e){var t=this.send(this.props.action,this.props.value);return t&&t instanceof n.Action&&t.onOpen(this.props.onOpen).onUpdate(this.props.onUpdate).onCancel(this.props.onCancel).onDone(this.props.onDone).onError(this.props.onError),this.props.onClick&&this.props.onClick(e,t),t},p.prototype.render=function(){var e=n.merge(this.props,{onClick:this.click});return delete e.tag,delete e.action,delete e.value,delete e.onOpen,delete e.onDone,delete e.onUpdate,delete e.onCancel,delete e.onError,delete e.send,"button"===this.props.tag&&null==e.type&&(e.type="button"),t.createElement(this.props.tag,e)},p}(t.PureComponent);s.contextTypes={send:p},s.defaultProps={tag:"button"},exports.default=s;

@@ -1,1 +0,1 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),n=require("../microcosm.js"),o=e(require("form-serialize")),r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},p=function(e){function o(t,n){r(this,o);var i=s(this,e.call(this,t,n));return i.send=i.props.send||i.context.send,i.onSubmit=i.onSubmit.bind(i),i}return i(o,e),o.prototype.render=function(){var e=n.merge({},this.props,{ref:"form",onSubmit:this.onSubmit});return delete e.action,delete e.prepare,delete e.serializer,delete e.onOpen,delete e.onDone,delete e.onUpdate,delete e.onCancel,delete e.onError,delete e.send,t.createElement("form",e)},o.prototype.onSubmit=function(e){e.preventDefault(),this.submit(e)},o.prototype.submit=function(e){var t=this.refs.form,o=this.props.prepare(this.props.serializer(t)),r=this.send(this.props.action,o);r&&r instanceof n.Action&&r.onOpen(this.props.onOpen).onUpdate(this.props.onUpdate).onCancel(this.props.onCancel).onDone(this.props.onDone).onError(this.props.onError),this.props.onSubmit(e,r)},o}(t.PureComponent);p.contextTypes={send:function(){}},p.defaultProps={action:null,serializer:function(e){return o(e,{hash:!0,empty:!0})},prepare:function(e){return e},onSubmit:function(e){return e}},exports.default=p;
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),n=require("../microcosm.js"),o=e(require("form-serialize")),r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},p=function(){},u=function(e){function o(t,n){r(this,o);var i=s(this,e.call(this,t,n));return i.send=i.props.send||i.context.send,i.onSubmit=i.onSubmit.bind(i),i}return i(o,e),o.prototype.render=function(){var e=n.merge(this.props,{ref:"form",onSubmit:this.onSubmit});return delete e.action,delete e.prepare,delete e.serializer,delete e.onOpen,delete e.onDone,delete e.onUpdate,delete e.onCancel,delete e.onError,delete e.send,t.createElement("form",e)},o.prototype.onSubmit=function(e){e.preventDefault(),this.submit(e)},o.prototype.submit=function(e){var t=this.refs.form,o=this.props.prepare(this.props.serializer(t)),r=this.send(this.props.action,o);r&&r instanceof n.Action&&r.onOpen(this.props.onOpen).onUpdate(this.props.onUpdate).onCancel(this.props.onCancel).onDone(this.props.onDone).onError(this.props.onError),this.props.onSubmit(e,r)},o}(t.PureComponent);u.contextTypes={send:p},u.defaultProps={action:null,serializer:function(e){return o(e,{hash:!0,empty:!0})},prepare:function(e){return e},onSubmit:function(e){return e}},exports.default=u;

@@ -1,1 +0,1 @@

"use strict";function r(r){return r&&"object"==typeof r&&"default"in r?r.default:r}function t(r){return"string"==typeof r}function n(r){return""===r||null===r||void 0===r}function e(r){return Array.isArray(r)?r:n(r)?[]:t(r)?r.trim().split(a):[r]}function u(r){var t=r;return!1===Array.isArray(r)&&(t=(""+t).split(f)),t.map(e)}function o(r,t,n){return t.reduce(function(t,n){return i.set(t,n,i.get(r,n))},n||{})}Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../microcosm.js"),l=r(i),a=".",f=",",s=function(){l.prototype.index=function(r,t){for(var n=arguments.length,e=Array(n>2?n-2:0),l=2;l<n;l++)e[l-2]=arguments[l];var a=this,f=u(t),s=null,p=null,c=null,y=function(){for(var r=arguments.length,t=Array(r),n=0;n<r;n++)t[n]=arguments[n];if(a.state!==s){var u=o(s=a.state,f,p);u!==p&&(p=u,c=e.reduce(function(r,t){return t.call(a,r,s)},p))}return t.reduce(function(r,t){return t.call(a,r,s)},c)};return this.indexes=i.set(this.indexes||{},r,y),y},l.prototype.lookup=function(r){var t=i.get(this.indexes,r);if(null==t){if(this.parent)return this.parent.lookup(r);throw new TypeError("Unable to find missing index "+r)}return t},l.prototype.compute=function(r){for(var t=arguments.length,n=Array(t>1?t-1:0),e=1;e<t;e++)n[e-1]=arguments[e];return this.lookup(r).apply(void 0,n)},l.prototype.memo=function(r){for(var t=arguments.length,n=Array(t>1?t-1:0),e=1;e<t;e++)n[e-1]=arguments[e];var u=this.lookup(r),o=null,i=null;return function(){var r=u();return r!==o&&(o=r,i=u.apply(void 0,n)),i}}};exports.default=s;
"use strict";function r(r){return r&&"object"==typeof r&&"default"in r?r.default:r}function t(r,t,n){for(var o=e(t),u=r,i=0,l=o.length;i<l&&null!=u;i++)u=u[o[i]];return null==u?n:u}function n(r){return""===r||null===r||void 0===r}function e(r){return Array.isArray(r)?r:n(r)?[]:"string"==typeof r?r.trim().split(p):[r]}function o(r){return"string"==typeof r?(""+r).split(s).map(e):r.every(Array.isArray)?r:r.map(e)}function u(r,t,n){return t.reduce(function(t,n){return i.set(t,n,i.get(r,n))},n||{})}Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../microcosm.js"),l=r(i),a="function"==typeof Symbol?Symbol:{},f=t(a,"toStringTag","@@toStringTag"),p=".",s=",",c=function(){l.prototype.index=function(r,t){for(var n=arguments.length,e=Array(n>2?n-2:0),l=2;l<n;l++)e[l-2]=arguments[l];var a=this,f=o(t),p=null,s=null,c=null,y=function(){for(var r=arguments.length,t=Array(r),n=0;n<r;n++)t[n]=arguments[n];if(a.state!==p){var o=u(p=a.state,f,s);o!==s&&(s=o,c=e.reduce(function(r,t){return t.call(a,r,p)},s))}return t.reduce(function(r,t){return t.call(a,r,p)},c)};return this.indexes=i.set(this.indexes||{},r,y),y},l.prototype.lookup=function(r){var t=i.get(this.indexes,r);if(null==t){if(this.parent)return this.parent.lookup(r);throw new TypeError("Unable to find missing index "+r)}return t},l.prototype.compute=function(r){for(var t=arguments.length,n=Array(t>1?t-1:0),e=1;e<t;e++)n[e-1]=arguments[e];return this.lookup(r).apply(void 0,n)},l.prototype.memo=function(r){for(var t=arguments.length,n=Array(t>1?t-1:0),e=1;e<t;e++)n[e-1]=arguments[e];var o=this.lookup(r),u=null,i=null;return function(){var r=o();return r!==u&&(u=r,i=o.apply(void 0,n)),i}}};exports.default=c;

@@ -1,1 +0,1 @@

"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function e(t){return t&&"function"==typeof t.subscribe}function r(t){return t&&"function"==typeof t.call}function n(t,e,n){return r(t)?t.call(n,e.state,e):t}function o(){return this.props.children?i.Children.only(this.props.children):null}Object.defineProperty(exports,"__esModule",{value:!0});var i=t(require("react")),s=require("../microcosm.js"),p=t(s),u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},h=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},c=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},a=function(t){function r(e,n){u(this,r);var o=c(this,t.call(this));return o.repo=e,o.scope=n,o.bindings={},o.subscriptions={},o.value={},o.repo.on("change",o.compute,o),o}return h(r,t),r.prototype.track=function(t,e){var r=this,n=this.subscriptions[t],o=e.subscribe(function(e){return r.set(t,e)});this.subscriptions[t]=o,n&&n.unsubscribe()},r.prototype.bind=function(t){this.bindings={};for(var r in t){var n=t[r];e(n)?this.track(r,n):this.bindings[r]=n}this.compute()},r.prototype.set=function(t,e){var r=s.set(this.value,t,e);this.value!==r&&(this.value=r,this._emit("change",this.value))},r.prototype.compute=function(){var t=this.value,e=t;for(var r in this.bindings){var o=n(this.bindings[r],this.repo,this.scope);e=s.set(e,r,o)}t!==e&&(this.value=e,this._emit("change",e))},r.prototype.teardown=function(){for(var t in this.subscriptions)this.subscriptions[t].unsubscribe();this.repo.off("change",this.compute,this)},r}(s.Emitter),d=function(){},f=function(t){function e(r,n){u(this,e);var i=c(this,t.call(this));return i.render!==e.prototype.render?(i.defaultRender=i.render,i.render=e.prototype.render):i.defaultRender=o,i.send=i.send.bind(i),i}return h(e,t),e.prototype._beginSetup=function(t){this.repo=t.repo,this.mediator=t,this.setup(this.repo,this.props,this.state),this.model=this.mediator.updateModel(this.props,this.state),this.ready(this.repo,this.props,this.state)},e.prototype._beginTeardown=function(){this.teardown(this.repo,this.props,this.state)},e.prototype._requestRepo=function(t){var e=this.props.repo||t,r=this.getRepo(e,this.props,this.state);return this.didFork=r!==e,r},e.prototype.setup=function(t,e,r){},e.prototype.ready=function(t,e,r){},e.prototype.update=function(t,e,r){},e.prototype.teardown=function(t,e,r){},e.prototype.intercept=function(){return{}},e.prototype.componentWillUpdate=function(t,e){this.model=this.mediator.updateModel(t,e),this.update(this.repo,t,e)},e.prototype.getRepo=function(t,e){return t?t.fork():new p},e.prototype.send=function(){var t;return(t=this.mediator).send.apply(t,arguments)},e.prototype.getModel=function(t,e){return{}},e.prototype.render=function(){return i.createElement(l,{presenter:this,parentState:this.state,parentProps:this.props})},e}(i.PureComponent),l=function(t){function e(r,n){u(this,e);var o=c(this,t.call(this,r,n));return o.presenter=r.presenter,o.repo=o.presenter._requestRepo(n.repo),o.send=o.send.bind(o),o.state={repo:o.repo,send:o.send},o.model=new a(o.repo,o.presenter),o.model.on("change",o.setState,o),o}return h(e,t),e.prototype.getChildContext=function(){return{repo:this.repo,send:this.send}},e.prototype.componentWillMount=function(){this.presenter._beginSetup(this)},e.prototype.componentDidMount=function(){this.presenter.refs=this.refs},e.prototype.componentWillUnmount=function(){this.presenter.refs=this.refs,this.presenter.didFork&&this.repo.shutdown(),this.model.teardown(),this.presenter._beginTeardown()},e.prototype.render=function(){this.presenter.model=this.state;var t=this.presenter.view;return null!=t?i.createElement(t,s.merge(this.presenter.props,this.state)):this.presenter.defaultRender()},e.prototype.updateModel=function(t,e){var r=this.presenter.getModel(t,e);return this.model.bind(r),this.model.value},e.prototype.hasParent=function(){return s.get(this.repo,"history")===s.get(this.context,["repo","history"])},e.prototype.send=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=s.tag(t),i=this.presenter.intercept(),p=s.getRegistration(i,o,"resolve");return p?p.call.apply(p,[this.presenter,this.repo].concat(r)):this.hasParent()?this.context.send.apply(null,arguments):this.repo.push.apply(this.repo,arguments)},e}(i.PureComponent);l.contextTypes={repo:d,send:d},l.childContextTypes={repo:d,send:d},exports.default=f;
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function e(t){return t&&"function"==typeof t.subscribe}function r(t){return t&&"function"==typeof t.call}function n(t,e,n){return r(t)?t.call(n,e.state,e):t}function o(){return this.props.children?i.Children.only(this.props.children):null}Object.defineProperty(exports,"__esModule",{value:!0});var i=t(require("react")),s=require("../microcosm.js"),p=t(s),u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},c=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},h=function(t){function r(e,n){u(this,r);var o=c(this,t.call(this));return o.repo=e,o.scope=n,o.bindings={},o.subscriptions={},o.value={},o.repo.on("change",o.compute,o),o}return a(r,t),r.prototype.track=function(t,e){var r=this,n=this.subscriptions[t],o=e.subscribe(function(e){return r.set(t,e)});this.subscriptions[t]=o,n&&n.unsubscribe()},r.prototype.bind=function(t){this.bindings={};for(var r in t){var n=t[r];e(n)?this.track(r,n):this.bindings[r]=n}this.compute()},r.prototype.set=function(t,e){var r=s.set(this.value,t,e);this.value!==r&&(this.value=r,this._emit("change",this.value))},r.prototype.compute=function(){var t=this.value,e=t;for(var r in this.bindings){var o=n(this.bindings[r],this.repo,this.scope);e=s.set(e,r,o)}t!==e&&(this.value=e,this._emit("change",e))},r.prototype.teardown=function(){for(var t in this.subscriptions)this.subscriptions[t].unsubscribe();this.repo.off("change",this.compute,this)},r}(s.Emitter),d=function(){},f=function(t){function e(r,n){u(this,e);var i=c(this,t.call(this));return i.render!==e.prototype.render?(i.defaultRender=i.render,i.render=e.prototype.render):i.defaultRender=o,i.send=i.send.bind(i),i}return a(e,t),e.prototype._beginSetup=function(t){this.repo=t.repo,this.mediator=t,this.setup(this.repo,this.props,this.state),this.model=this.mediator.updateModel(this.props,this.state),this.ready(this.repo,this.props,this.state)},e.prototype._beginTeardown=function(){this.teardown(this.repo,this.props,this.state)},e.prototype._requestRepo=function(t){var e=this.props.repo||t,r=this.getRepo(e,this.props);return this.didFork=r!==e,r},e.prototype.setup=function(t,e,r){},e.prototype.ready=function(t,e,r){},e.prototype.update=function(t,e,r){},e.prototype.teardown=function(t,e,r){},e.prototype.intercept=function(){return{}},e.prototype.componentWillUpdate=function(t,e){this.model=this.mediator.updateModel(t,e),this.update(this.repo,t,e)},e.prototype.getRepo=function(t,e){return t?t.fork():new p},e.prototype.send=function(t){for(var e,r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(e=this.mediator).send.apply(e,[t].concat(n))},e.prototype.getModel=function(t,e){return{}},e.prototype.render=function(){return i.createElement(l,{presenter:this,parentState:this.state,parentProps:this.props})},e}(i.PureComponent),l=function(t){function e(r,n){u(this,e);var o=c(this,t.call(this,r,n));return o.presenter=r.presenter,o.repo=o.presenter._requestRepo(n.repo),o.send=o.send.bind(o),o.state={repo:o.repo,send:o.send},o.model=new h(o.repo,o.presenter),o.model.on("change",o.updateState,o),o}return a(e,t),e.prototype.getChildContext=function(){return{repo:this.repo,send:this.send,parent:this}},e.prototype.componentWillMount=function(){this.presenter._beginSetup(this)},e.prototype.componentDidMount=function(){this.presenter.refs=this.refs},e.prototype.componentWillUnmount=function(){this.presenter.refs=this.refs,this.presenter.didFork&&this.repo.shutdown(),this.model.teardown(),this.presenter._beginTeardown()},e.prototype.render=function(){this.presenter.model=this.state;var t=this.presenter.view;return null!=t?i.createElement(t,s.merge(this.presenter.props,this.state)):this.presenter.defaultRender()},e.prototype.updateState=function(t){this.setState(t)},e.prototype.updateModel=function(t,e){var r=this.presenter.getModel(t,e);return this.model.bind(r),this.model.value},e.prototype.getParent=function(){return this.context.parent},e.prototype.getHandler=function(t){var e=this.presenter.intercept();return s.getRegistration(e,t,"resolve")},e.prototype.send=function(t){for(var e,r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];for(var i=s.tag(t),p=this;p;){var u=p.getHandler(i);if(u)return u.call.apply(u,[p,p.repo].concat(n));p=p.getParent()}return(e=this.repo).push.apply(e,arguments)},e}(i.PureComponent);l.contextTypes={repo:d,send:d,parent:d},l.childContextTypes={repo:d,send:d,parent:d},exports.default=f;

@@ -1,1 +0,1 @@

"use strict";function t(t){return""===t||null===t||void 0===t}function e(e){return Array.isArray(e)?e:t(e)?[]:d(e)?e.trim().split(k):[e]}function n(t){var n=t;return!1===Array.isArray(t)&&(n=(""+n).split(A)),n.map(e)}function r(t){return t.join(k)}function o(t){return t.map(r).join(A)}function i(t){return""+t+D++}function s(t){if(Array.isArray(t))return t.slice(0);if(!1===f(t))return t;var e={};for(var n in t)e[n]=t[n];return e}function a(){for(var t=null,e=null,n=0,r=arguments.length;n<r;n++){t=t||arguments[n],e=e||t;var o=arguments[n];for(var i in o)t[i]!==o[i]&&(t===e&&(t=s(e)),t[i]=o[i])}return t}function u(t,e,n){return t.__proto__=e,t.prototype=a(Object.create(e.prototype),{constructor:t.prototype.constructor},n),t}function p(t,n,r){if(null==t)return r;for(var o=e(n),i=0,s=o.length;i<s;i++){var a=null==t?void 0:t[o[i]];if(void 0===a)return r;t=a}return t}function c(t,n,r){var o=e(n),i=o.length;if(i<=0)return r;if(p(t,o)===r)return t;for(var a=s(t),u=a,c=0;c<i;c++){var h=o[c],f=r;c<i-1&&(f=h in u?s(u[h]):{}),u[h]=f,u=u[h]}return a}function h(t){return(f(t)||l(t))&&l(t.then)}function f(t){return!!t&&"object"===(void 0===t?"undefined":j(t))}function l(t){return!!t&&"function"==typeof t}function d(t){return"string"==typeof t}function y(t){return p(t,N,"")}function v(t){return"GeneratorFunction"===y(t)}function g(t,e,n){return l(t)?new t(e,n):Object.create(t)}function m(t,n,r,o){var i=e(n);return!1===l(r)?c(t,i,r):c(t,i,r(p(t,i,o)))}function b(t,e){if(!0===t.__tagged)return t;d(t)&&(e=t,t=function(t){return t}),q+=1;var n=e||(t.name||J)+"."+q;return t.open=n+".open",t.loading=n+".loading",t.update=t.loading,t.done=n,t.resolve=t.done,t.error=n+".error",t.reject=t.error,t.cancel=n+".cancel",t.cancelled=t.cancel,t.toString=function(){return n},t.__tagged=!0,t}function _(t,e,n){return function(r){return!1===t.complete&&(t.status=e,t.complete=n,arguments.length>0&&(t.payload=r),t._emit("change",t),t._emit(e,t.payload)),t}}function w(t){return function(e){!0===t.batch?L(e,M):e()}}function x(t,e){return function(n,r){var o=t;if(e)try{o=r.deserialize(t)}catch(t){throw n.reject(t),t}var i=r.domains.sanitize(o);n.resolve(i)}}function S(t,e,n){var r=Y[n],o=t[e],i=e[n];return f(o)?o[r]||o[n]:t[i]}function O(t,e,n){function r(e){var n=i.next(e);n.done?t.resolve(e):o(n.value)}function o(e){Array.isArray(e)&&(e=n.parallel(e)),e.onDone(r),e.onCancel(t.cancel,t),e.onError(t.reject,t)}t.open();var i=e(n);return r(),t}function z(t,e,n,r){var o=e.apply(null,n);return h(o)?(t.open.apply(t,n),o.then(function(e){return global.setTimeout(function(){return t.resolve(e)},0)},function(e){return global.setTimeout(function(){return t.reject(e)},0)}),t):v(o)?O(t,o,r):l(o)?(o(t,r),t):t.resolve(o)}Object.defineProperty(exports,"__esModule",{value:!0});var k=".",A=",",j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},I=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),P=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},R=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},D=0,H="function"==typeof Symbol?Symbol:{},N=H.toStringTag||"@@toStringTag",T=function t(e,n,r,o){E(this,t),this.event=e,this.fn=n,this.scope=r,this.once=o},C=function(){function t(){E(this,t),this._events=[]}return t.prototype.on=function(t,e,n){var r=new T(t,e,n,!1);return this._events.push(r),this},t.prototype.once=function(t,e,n){var r=new T(t,e,n,!0);return this._events.push(r),this},t.prototype.off=function(t,e,n){for(var r=null==e,o=0;o<this._events.length;){var i=this._events[o];i.event===t&&(r||i.fn===e&&i.scope===n)?this._events.splice(o,1):o+=1}return this},t.prototype.removeAllListeners=function(){this._events.length=0},t.prototype._emit=function(t){for(var e=0,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(;e<this._events.length;){var i=this._events[e];i.event===t&&(i.fn.apply(i.scope||this,r),i.once)?this._events.splice(e,1):e+=1}return this},t.prototype._removeScope=function(t){for(var e=0;e<this._events.length;)t!==this._events[e].scope?e+=1:this._events.splice(e,1)},t}(),q=0,J="_action",K=function(t){function e(n,r){E(this,e);var o=R(this,t.call(this));return o.id=i("action"),o.command=b(n),o.status="inactive",o.payload=void 0,o.disabled=!1,o.complete=!1,o.parent=null,o.next=null,o.timestamp=Date.now(),o.children=[],r&&o[r](),o}return P(e,t),e.prototype.onOpen=function(t,e){return this._callOrSubscribeOnce("open",t,e),this},e.prototype.onUpdate=function(t,e){return t&&this.on("update",t,e),this},e.prototype.onDone=function(t,e){return this._callOrSubscribeOnce("resolve",t,e),this},e.prototype.onError=function(t,e){return this._callOrSubscribeOnce("reject",t,e),this},e.prototype.onCancel=function(t,e){return this._callOrSubscribeOnce("cancel",t,e),this},e.prototype.is=function(t){return this.command[this.status]===this.command[t]},e.prototype.toggle=function(t){return this.disabled=!this.disabled,t||this._emit("change",this),this},e.prototype.link=function(t){var e=this,n=t.length,r=function(){(n-=1)<=0&&e.resolve()};return t.forEach(function(t){t.onDone(r),t.onCancel(r),t.onError(e.reject)}),this},e.prototype.then=function(t,e){var n=this;return new Promise(function(t,e){n.onDone(t),n.onError(e)}).then(t,e)},e.prototype.isDisconnected=function(){return!this.parent},e.prototype.prune=function(){this.parent.parent=null},e.prototype.lead=function(t){this.next=t,t&&this.adopt(t)},e.prototype.adopt=function(t){this.children.indexOf(t)<0&&this.children.push(t),t.parent=this},e.prototype.remove=function(){this.parent.abandon(this),this.removeAllListeners()},e.prototype.abandon=function(t){var e=this.children.indexOf(t);e>=0&&(this.children.splice(e,1),t.parent=null),this.next===t&&this.lead(t.next)},e.prototype._callOrSubscribeOnce=function(t,e,n){e&&(this.is(t)?e.call(n,this.payload):this.once(t,e,n))},e.prototype.toJSON=function(){return{id:this.id,status:this.status,type:this.type,payload:this.payload,disabled:this.disabled,children:this.children,next:this.next&&this.next.id}},I(e,[{key:"type",get:function(){return this.command[this.status]}},{key:"open",get:function(){return _(this,"open",!1)}},{key:"update",get:function(){return _(this,"update",!1)}},{key:"resolve",get:function(){return _(this,"resolve",!0)}},{key:"reject",get:function(){return _(this,"reject",!0)}},{key:"cancel",get:function(){return _(this,"cancel",!0)}}]),e}(C),L=global.requestIdleCallback||function(t){return setTimeout(t,4)},M={timeout:36},B=b(function(t,e){return x(t,e)},"$reset"),G=b(function(t,e){return x(t,e)},"$patch"),Q=function(){},U=function(){},$=function(t){return t},F={maxHistory:1,batch:!1,updater:w},V=function(t){function e(n){E(this,e);var r=R(this,t.call(this)),o=a(F,n);return r.size=0,r.limit=Math.max(1,o.maxHistory),r.updater=o.updater(o),r.releasing=!1,r.release=function(){return r.closeRelease()},r.begin(),r}return P(e,t),e.prototype.checkout=function(t){var e=this.sharedRoot(t)||this.head;this.head=t||this.head;for(var n=this.head;n!=e;){var r=n.parent;r.next=n,n=r}return this.setSize(),this.reconcile(e),this},e.prototype.toggle=function(t){var e=[].concat(t);e.forEach(function(t){return t.toggle("silently")});var n=void 0,r=1/0,o=this.toArray();e.forEach(function(t){var e=o.indexOf(t);e>=0&&e<r&&(r=e,n=t)}),n&&this.reconcile(n)},e.prototype.toArray=function(){return this.map(function(t){return t})},e.prototype.map=function(t,e){for(var n=[],r=this.root;r&&(n.push(t.call(e,r)),r!=this.head);)r=r.next;return n},e.prototype.wait=function(){var t=this,e=this.toArray();return new Promise(function(n,r){var o=function o(){var i=e.every(function(t){return t.complete}),s=e.filter(function(t){return t.is("reject")});i&&(t.off("release",o),s.length?r(s[0].payload):n())};!1===t.releasing&&o(),t.on("release",o)})},e.prototype.then=function(t,e){return this.wait().then(t,e)},e.prototype.begin=function(){this.head=this.root=null,this.append(U,"resolve")},e.prototype.append=function(t,e){var n=new K(t,e);return this.size>0?this.head.lead(n):(new K(Q,"resolve").adopt(n),this.root=n),this.head=n,this.size+=1,this._emit("append",n),n.on("change",this.reconcile,this),this.head},e.prototype.remove=function(t){if(!t.isDisconnected()){var e=t.parent,n=t.next,r=this.isActive(t);this.clean(t),this.size<=0?this.begin():(t===this.head?n=this.head=e:t===this.root&&(this.root=n),r&&!t.disabled&&this.reconcile(n))}},e.prototype.clean=function(t){this.size-=1,this._emit("remove",t),t.remove()},e.prototype.reconcile=function(t){for(var e=t;e&&(this._emit("update",e),e!==this.head);)e=e.next;this.archive(),this._emit("reconcile",t),this.queueRelease()},e.prototype.queueRelease=function(){!1===this.releasing&&(this.releasing=!0,this.updater(this.release))},e.prototype.closeRelease=function(){this.releasing=!1,this._emit("release")},e.prototype.archive=function(){for(var t=this.size,e=this.root;t>this.limit&&e.complete;)t-=1,this._emit("remove",e.parent),e=e.next;e.prune(),this.root=e,this.size=t},e.prototype.setSize=function(){for(var t=this.head,e=1;t!==this.root;)t=t.parent,e+=1;this.size=e},e.prototype.isActive=function(t){for(var e=t;e;){if(e===this.head)return!0;e=e.next}return!1},e.prototype.sharedRoot=function(t){for(var e=t;e;){if(this.isActive(e))return e;e=e.parent}},e.prototype.toJSON=function(){return{head:this.head.id,root:this.root.id,size:this.size,tree:this.root}},e}(C),W=function(){function t(){E(this,t),this.pool={}}return t.prototype.create=function(t){this.set(t,this.get(t.parent))},t.prototype.get=function(t,e){var n=this.pool[t.id];return void 0===n?e:n},t.prototype.set=function(t,e){this.pool[t.id]=e},t.prototype.remove=function(t){delete this.pool[t.id]},t}(),X=function(){function t(){E(this,t)}return t.prototype.setup=function(t){this.repo=t},t.prototype.reset=function(t,e){var n=this.repo.domains.sanitize(e);return a(t,this.repo.getInitialState(),n)},t.prototype.patch=function(t,e){return a(t,this.repo.domains.sanitize(e))},t.prototype.addDomain=function(t){return a(this.repo.getInitialState(),t)},t.prototype.register=function(){var t;return t={},t[B]=this.reset,t[G]=this.patch,t[$]=this.addDomain,t},t}(),Y={inactive:"inactive",open:"open",update:"loading",loading:"update",done:"resolve",resolve:"done",reject:"error",error:"reject",cancel:"cancelled",cancelled:"cancel"},Z=function(){function t(e){E(this,t),this.registry={},this.repo=e,this.domains=[],this.add([],X)}return t.prototype.getRepoHandlers=function(t){var e=t.command,n=t.status,r=null;return this.repo.register&&(r=S(this.repo.register(),e,n)),r?[{key:[],domain:this.repo,handler:r}]:[]},t.prototype.getHandlers=function(t){for(var e=this.getRepoHandlers(t),n=t.command,r=t.status,o=0,i=this.domains.length;o<i;o++){var s=this.domains[o],a=s[0],u=s[1];if(u.register){var p=S(u.register(),n,r);p&&e.push({key:a,domain:u,handler:p})}}return e},t.prototype.register=function(t){var e=t.type;return this.registry[e]||(this.registry[e]=this.getHandlers(t)),this.registry[e]},t.prototype.add=function(t,n,r){var o=g(n,r,this.repo);return this.domains.push([e(t),o]),this.registry={},o.setup&&o.setup(this.repo,r),o.teardown&&this.repo.on("teardown",o.teardown,o),o},t.prototype.reduce=function(t,e,n){for(var r=e,o=1,i=this.domains.length;o<i;o++){var s=this.domains[o],a=s[0],u=s[1];r=t.call(n,r,a,u)}return r},t.prototype.supportsKey=function(t){return t in this.repo.state||this.domains.some(function(e){return r(e[0])===t})},t.prototype.sanitize=function(t){var e=this.repo.parent,n={};for(var r in t)e&&e.domains.supportsKey(r)||this.supportsKey(r)&&(n[r]=t[r]);return n},t.prototype.dispatch=function(t,e){for(var n=this.register(e),r=0,o=n.length;r<o;r++){var i=n[r],s=i.key,a=i.domain,u=i.handler,h=p(t,s);t=c(t,s,u.call(a,h,e.payload))}return t},t.prototype.deserialize=function(t){return this.reduce(function(e,n,r){return r.deserialize?c(e,n,r.deserialize(p(t,n))):e},t)},t.prototype.serialize=function(t,e){return this.reduce(function(e,n,r){return r.serialize?c(e,n,r.serialize(p(t,n))):e},e)},t}(),tt=function(){function t(e){E(this,t),this.repo=e,this.effects=[]}return t.prototype.add=function(t,e){var n=g(t,e,this.repo);return n.setup&&n.setup(this.repo,e),n.teardown&&this.repo.on("teardown",n.teardown,n),this.effects.push(n),n},t.prototype.dispatch=function(t){for(var e=t.command,n=t.payload,r=t.status,o=0,i=this.effects.length;o<i;o++){var s=this.effects[o];if(s.register){var a=S(s.register(),e,r);a&&a.call(s,this.repo,n)}}},t}(),et=function(){function t(e,n,r){E(this,t),this.id=e,this.key=n,this.edges=[],this.parent=r||null,r&&r.connect(this)}return t.getId=function(t,e){return e&&e.id?e.id+"."+t:t},t.prototype.connect=function(t){t!==this&&this.edges.indexOf(t)<0&&this.edges.push(t)},t.prototype.disconnect=function(t){var e=this.edges.indexOf(t);~e&&this.edges.splice(e,1)},t.prototype.isAlone=function(){return this.edges.length<=0},t.prototype.orphan=function(){this.parent&&this.parent.disconnect(this)},t}(),nt=function(t){function e(r,o){E(this,e);var i=R(this,t.call(this));return i.id=r,i.keyPaths=n(o),i}return P(e,t),e.getId=function(t){return"query:"+o(n(t))},e.prototype.extract=function(t){for(var e=this.keyPaths.length,n=Array(e),r=0;r<e;r++)n[r]=p(t,this.keyPaths[r]);return n},e.prototype.trigger=function(t){var e=this.extract(t);this._emit.apply(this,["change"].concat(e))},e.prototype.isAlone=function(){return this._events.length<=0},e}(C),rt="",ot=function(){function t(e){E(this,t),this.snapshot=e,this.nodes={}}return t.prototype.on=function(t,e,r){for(var o=n(t),i=nt.getId(t),s=this.addQuery(i,o),a=0;a<o.length;a++)this.addBranch(o[a],s);return s.on("change",e,r),s},t.prototype.off=function(t,e,n){var r=nt.getId(t),o=this.nodes[r];o&&(o.off("change",e,n),o.isAlone()&&this.prune(o))},t.prototype.update=function(t){var e=this.snapshot;if(this.snapshot=t,this.nodes[rt])for(var n=this.scan(this.nodes[rt],e,t,[]),r=0;r<n.length;r++)n[r].trigger(t)},t.prototype.addNode=function(t,e){var n=et.getId(t,e);return this.nodes[n]||(this.nodes[n]=new et(n,t,e)),this.nodes[n]},t.prototype.addQuery=function(t,e){return this.nodes[t]||(this.nodes[t]=new nt(t,e)),this.nodes[t]},t.prototype.remove=function(t){delete this.nodes[t.id]},t.prototype.prune=function(t){for(var e=t.keyPaths.map(r),n=0,o=e.length;n<o;n++){var i=this.nodes[e[n]];i.disconnect(t);do{if(!i.isAlone())break;i.orphan(),this.remove(i),i=i.parent}while(i)}this.remove(t)},t.prototype.addBranch=function(t,e){for(var n=this.addNode(rt,null),r=0,o=t.length;r<o;r++)n=this.addNode(t[r],n);n.connect(e)},t.prototype.scan=function(t,e,n,r){if(e!==n)for(var o=t.edges,i=0,s=o.length;i<s;i++){var a=o[i];if(a instanceof nt&&r.indexOf(a)<0)r.push(a);else{var u=null==e?e:e[a.key],p=null==n?n:n[a.key];this.scan(a,u,p,r)}}return r},t}(),it={maxHistory:0,parent:null,batch:!1},st=function(t){function e(n,r,o){E(this,e);var i=R(this,t.call(this)),s=a(it,i.constructor.defaults,n);return i.parent=s.parent,i.initial=i.parent?i.parent.initial:i.getInitialState(),i.state=i.parent?i.parent.state:i.initial,i.history=i.parent?i.parent.history:new V(s),i.archive=new W,i.domains=new Z(i),i.effects=new tt(i),i.changes=new ot(i.state),i.history.on("append",i.createSnapshot,i),i.history.on("update",i.updateSnapshot,i),i.history.on("remove",i.removeSnapshot,i),i.history.on("reconcile",i.dispatchEffect,i),i.history.on("release",i.release,i),i.setup(s),r&&i.reset(r,o),i}return P(e,t),e.prototype.setup=function(){},e.prototype.teardown=function(){},e.prototype.getInitialState=function(){return null==this.initial?{}:this.initial},e.prototype.recall=function(t,e){return this.archive.get(t,e)},e.prototype.createSnapshot=function(t){this.archive.create(t)},e.prototype.updateSnapshot=function(t){var e=this.recall(t.parent,this.initial);this.parent&&(e=a(e,this.parent.recall(t))),t.disabled||(e=this.domains.dispatch(e,t)),this.archive.set(t,e),this.state=e},e.prototype.removeSnapshot=function(t){this.archive.remove(t)},e.prototype.dispatchEffect=function(t){this.effects.dispatch(t)},e.prototype.release=function(){this.changes.update(this.state)},e.prototype.on=function(t,e,n){var r=t.split(":",2),o=r[0],i=r[1];switch(o){case"change":this.changes.on(i||"",e,n);break;default:C.prototype.on.apply(this,arguments)}return this},e.prototype.off=function(t,e,n){var r=t.split(":",2),o=r[0],i=r[1];switch(o){case"change":this.changes.off(i||"",e,n);break;default:C.prototype.off.apply(this,arguments)}return this},e.prototype.append=function(t,e){return this.history.append(t,e)},e.prototype.push=function(t){for(var e=this.append(t),n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return z(e,e.command,r,this),e},e.prototype.prepare=function(){for(var t=this,e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(){for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];return t.push.apply(t,n.concat(r))}},e.prototype.addDomain=function(t,e,n){var r=this.domains.add(t,e,n);return r.getInitialState&&(this.initial=c(this.initial,t,r.getInitialState())),this.push($,r),r},e.prototype.addEffect=function(t,e){return this.effects.add(t,e)},e.prototype.reset=function(t,e){return this.push(B,t,e)},e.prototype.patch=function(t,e){return this.push(G,t,e)},e.prototype.deserialize=function(t){var e=t;return this.parent?e=this.parent.deserialize(t):d(e)&&(e=JSON.parse(e)),this.domains.deserialize(e)},e.prototype.serialize=function(){var t=this.parent?this.parent.serialize():{};return this.domains.serialize(this.state,t)},e.prototype.toJSON=function(){return this.serialize()},e.prototype.checkout=function(t){return this.history.checkout(t),this},e.prototype.fork=function(){return new e({parent:this})},e.prototype.shutdown=function(){this.teardown(),this._emit("teardown",this),this.history._removeScope(this),this.removeAllListeners()},e.prototype.parallel=function(t){return this.append("GROUP").link(t)},e}(C);exports.default=st,exports.Microcosm=st,exports.Action=K,exports.History=V,exports.Emitter=C,exports.tag=b,exports.get=p,exports.set=c,exports.update=m,exports.merge=a,exports.inherit=u,exports.getRegistration=S;
"use strict";function t(t){return Array.isArray(t)?t:f(t)?[]:"string"==typeof t?t.trim().split(x):[t]}function e(e){return"string"==typeof e?(""+e).split(O).map(t):e.every(Array.isArray)?e:e.map(t)}function n(t){return t.join(x)}function r(t){return t.map(n).join(O)}function i(t){return""+t+I++}function o(t){if(Array.isArray(t))return t.slice(0);if(!1===h(t))return{};var e={};for(var n in t)e[n]=t[n];return e}function s(){for(var t=null,e=null,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var s=0,a=r.length;s<a;s++){t=t||r[s],e=e||t;var p=r[s];for(var u in p)t[u]!==p[u]&&(t===e&&(t=o(e)),t[u]=p[u])}return t||{}}function a(e,n,r){for(var i=t(n),o=e,s=0,a=i.length;s<a&&null!=o;s++)o=o[i[s]];return null==o?r:o}function p(e,n,r){var i=t(n),s=i.length;if(s<=0)return r;if(a(e,i)===r)return e;for(var p=o(e),u=p,h=0;h<s;h++){var c=i[h],f=r;h<s-1&&(f=c in u?o(u[c]):{}),u[c]=f,u=u[c]}return p}function u(t){return(h(t)||c(t))&&c(t.then)}function h(t){return!(!t||"object"!==(void 0===t?"undefined":z(t)))}function c(t){return!!t&&"function"==typeof t}function f(t){return""===t||null===t||void 0===t}function l(t){return t?t[R]||"":""}function d(t){return"GeneratorFunction"===l(t)}function y(t,e,n){return c(t)?new t(e,n):Object.create(t)}function v(e,n,r,i){var o=t(n);return!1===c(r)?p(e,o,r):p(e,o,r(a(e,o,i)))}function g(t,e){if("string"==typeof t)return g(function(t){return t},t);if(!0===t.__tagged)return t;D+=1;var n=e||(t.name||H)+"."+D,r=t;return r.open=n+".open",r.loading=n+".loading",r.update=r.loading,r.done=n,r.resolve=r.done,r.error=n+".error",r.reject=r.error,r.cancel=n+".cancel",r.cancelled=t.cancel,r.toString=function(){return n},t.__tagged=!0,r}function m(t){return function(e){!0===t.batch?C(e,L):e()}}function b(t,e){return function(n,r){var i=t;if(e)try{i=r.deserialize(t)}catch(t){throw n.reject(t),t}var o=r.domains.sanitize(i);n.resolve(o)}}function S(t,e,n){var r=X[n],i=t[e],o=e[n]||"";return h(i)?i[r]||i[n]:t[o]}function _(t,e,n){function r(e){var n=o.next(e);n.done?t.resolve(e):i(n.value)}function i(e){return Array.isArray(e)?i(n.parallel(e)):(e.onDone(r),e.onCancel(t.cancel,t),e.onError(t.reject,t),e)}t.open();var o=e(n);return r(),t}function w(t,e,n,r){if("string"==typeof e)return t.resolve.apply(t,n);var i=e.apply(null,n);return u(i)?(t.open.apply(t,n),i.then(function(e){return global.setTimeout(function(){return t.resolve(e)},0)},function(e){return global.setTimeout(function(){return t.reject(e)},0)}),t):d(i)?_(t,i,r):c(i)?(i(t,r),t):t.resolve(i)}Object.defineProperty(exports,"__esModule",{value:!0});var x=".",O=",",z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},A=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),j=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},E=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},I=0,P="function"==typeof Symbol?Symbol:{},R=a(P,"toStringTag","@@toStringTag"),q=function(){function t(){k(this,t),this._events=[]}return t.prototype.on=function(t,e,n){var r={event:t,fn:e,scope:n,once:!1};return this._events.push(r),this},t.prototype.once=function(t,e,n){var r={event:t,fn:e,scope:n,once:!0};return this._events.push(r),this},t.prototype.off=function(t,e,n){for(var r=null==e,i=0;i<this._events.length;){var o=this._events[i];o.event===t&&(r||o.fn===e&&o.scope===n)?this._events.splice(i,1):i+=1}return this},t.prototype.removeAllListeners=function(){this._events.length=0},t.prototype._emit=function(t){for(var e=0,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(;e<this._events.length;){var o=this._events[e];o.event===t&&(o.fn.apply(o.scope||this,r),o.once)?this._events.splice(e,1):e+=1}return this},t.prototype._removeScope=function(t){for(var e=0;e<this._events.length;)t!==this._events[e].scope?e+=1:this._events.splice(e,1)},t}(),D=0,H="_action",N={inactive:!1,open:!1,update:!1,resolve:!0,reject:!0,cancel:!0},T=function(t){function e(n,r){k(this,e);var o=E(this,t.call(this));return o.id=i("action"),o.command=g(n),o.status="inactive",o.payload=void 0,o.disabled=!1,o.complete=!1,o.parent=null,o.next=null,o.timestamp=Date.now(),o.children=[],r&&o.setState(r),o}return j(e,t),e.prototype.onOpen=function(t,e){return this._callOrSubscribeOnce("open",t,e),this},e.prototype.onUpdate=function(t,e){return t&&this.on("update",t,e),this},e.prototype.onDone=function(t,e){return this._callOrSubscribeOnce("resolve",t,e),this},e.prototype.onError=function(t,e){return this._callOrSubscribeOnce("reject",t,e),this},e.prototype.onCancel=function(t,e){return this._callOrSubscribeOnce("cancel",t,e),this},e.prototype.is=function(t){return this.command[this.status]===this.command[t]},e.prototype.toggle=function(t){return this.disabled=!this.disabled,t||this._emit("change",this),this},e.prototype.link=function(t){var e=this,n=t.length,r=function(){(n-=1)<=0&&e.resolve()};return t.forEach(function(t){t.onDone(r),t.onCancel(r),t.onError(e.reject)}),this},e.prototype.then=function(t,e){var n=this;return new Promise(function(t,e){n.onDone(t),n.onError(e)}).then(t,e)},e.prototype.isDisconnected=function(){return!this.parent},e.prototype.prune=function(){this.parent&&(this.parent.parent=null)},e.prototype.lead=function(t){this.next=t,t&&this.adopt(t)},e.prototype.adopt=function(t){this.children.indexOf(t)<0&&this.children.push(t),t.parent=this},e.prototype.remove=function(){this.parent&&this.parent.abandon(this),this.removeAllListeners()},e.prototype.abandon=function(t){var e=this.children.indexOf(t);e>=0&&(this.children.splice(e,1),t.parent=null),this.next===t&&this.lead(t.next)},e.prototype._callOrSubscribeOnce=function(t,e,n){e&&(this.is(t)?e.call(n,this.payload):this.once(t,e,n))},e.prototype.setState=function(t,e){return this.complete?this:(this.status=t,this.complete=N[t],arguments.length>1&&(this.payload=e),this._emit("change",this),this._emit(t,this.payload),this)},e.prototype.toJSON=function(){return{id:this.id,status:this.status,type:this.type,payload:this.payload,disabled:this.disabled,children:this.children,next:this.next&&this.next.id}},A(e,[{key:"type",get:function(){return this.command[this.status]||""}},{key:"open",get:function(){return this.setState.bind(this,"open")}},{key:"update",get:function(){return this.setState.bind(this,"update")}},{key:"resolve",get:function(){return this.setState.bind(this,"resolve")}},{key:"reject",get:function(){return this.setState.bind(this,"reject")}},{key:"cancel",get:function(){return this.setState.bind(this,"cancel")}}]),e}(q),C=global.requestIdleCallback||function(t){return setTimeout(t,4)},L={timeout:36},J=function(t,e){return b(t,e)},G=function(t,e){return b(t,e)},K=function(){},M=function(){},U=function(t){return t},B={maxHistory:1,batch:!1,updater:m},Q=function(t){function e(n){k(this,e);var r=E(this,t.call(this)),i=s(B,n);return r.size=0,r.setLimit(i.maxHistory),r.updater=i.updater(i),r.releasing=!1,r.release=function(){return r.closeRelease()},r.begin(),r}return j(e,t),e.prototype.checkout=function(t){var e=this.sharedRoot(t);this.head=t||this.head;for(var n=this.head;n&&n!==e;){var r=n.parent;r&&r.lead(n),n=r}return this.setSize(),this.reconcile(e),this},e.prototype.toggle=function(t){var e=[].concat(t);e.forEach(function(t){return t.toggle(!0)});var n=void 0,r=1/0,i=this.toArray();e.forEach(function(t){var e=i.indexOf(t);e>=0&&e<r&&(r=e,n=t)}),n&&this.reconcile(n)},e.prototype.toArray=function(){return this.map(function(t){return t})},e.prototype.map=function(t,e){for(var n=[],r=this.root;r&&(n.push(t.call(e,r)),r!=this.head);)r=r.next;return n},e.prototype.wait=function(){var t=this,e=new T("GROUP");return e.link(this.toArray()),e.then(function(){if(t.releasing)return new Promise(function(e){t.once("release",e)})})},e.prototype.then=function(t,e){return this.wait().then(t,e)},e.prototype.begin=function(){this.root=this.head=this.append(M,"resolve")},e.prototype.append=function(t,e){var n=new T(t,e);return this.head?this.head.lead(n):(new T(K,"resolve").adopt(n),this.root=n),this.head=n,this.size+=1,this._emit("append",n),n.on("change",this.reconcile,this),n},e.prototype.remove=function(t){if(!t.isDisconnected()){var e=t.parent,n=t.next,r=this.isActive(t);this.clean(t),this.size<=0?this.begin():(t===this.head&&e?n=this.head=e:t===this.root&&n&&(this.root=n),n&&r&&!t.disabled&&this.reconcile(n))}},e.prototype.clean=function(t){this.size-=1,this._emit("remove",t),t.remove()},e.prototype.reconcile=function(t){for(var e=t;e&&(this._emit("update",e),e!==this.head);)e=e.next;this.archive(),this._emit("reconcile",t),this.queueRelease()},e.prototype.queueRelease=function(){!1===this.releasing&&(this.releasing=!0,this.updater(this.release))},e.prototype.closeRelease=function(){this.releasing=!1,this._emit("release")},e.prototype.archive=function(){for(var t=this.size,e=this.root;t>this.limit&&e.complete;)t-=1,this._emit("remove",e.parent),e.next&&(e=e.next);e.prune(),this.root=e,this.size=t},e.prototype.setSize=function(){for(var t=this.head,e=1;t&&t!==this.root;)t=t.parent,e+=1;this.size=e},e.prototype.setLimit=function(t){this.limit=Math.max(0,t)},e.prototype.isActive=function(t){for(var e=t;e;){if(e===this.head)return!0;e=e.next}return!1},e.prototype.sharedRoot=function(t){for(var e=t;e;){if(this.isActive(e))return e;e=e.parent}return this.head},e.prototype.toJSON=function(){return{head:this.head.id,root:this.root.id,size:this.size,tree:this.root}},e}(q),F=function(){function t(){k(this,t),this.pool={}}return t.prototype.create=function(t){this.set(t,this.get(t.parent))},t.prototype.get=function(t,e){return t&&this.has(t)?this.pool[t.id]:null==e?{}:e},t.prototype.has=function(t){return void 0!==this.pool[t.id]},t.prototype.set=function(t,e){this.pool[t.id]=e},t.prototype.remove=function(t){delete this.pool[t.id]},t}(),V=function(){function t(){k(this,t)}return t.prototype.setup=function(t){this.repo=t},t.prototype.reset=function(t,e){var n=this.repo.domains.sanitize(e);return s(t,this.repo.getInitialState(),n)},t.prototype.patch=function(t,e){return s(t,this.repo.domains.sanitize(e))},t.prototype.addDomain=function(t){return s(this.repo.getInitialState(),t)},t.prototype.register=function(){var t;return t={},t[J.toString()]=this.reset,t[G.toString()]=this.patch,t[U.toString()]=this.addDomain,t},t}(),W=function t(e,n,r){k(this,t),this.key=e,this.domain=n,this.handler=r},X={inactive:"inactive",open:"open",update:"loading",loading:"update",done:"resolve",resolve:"done",reject:"error",error:"reject",cancel:"cancelled",cancelled:"cancel"},Y=function(){function e(t){k(this,e),this.repo=t,this.registry={},this.domains=[],this.add([],V)}return e.prototype.getRepoHandlers=function(t){var e=t.command,n=t.status,r=S(this.repo.register(),e,n);return r?[new W([],this.repo,r)]:[]},e.prototype.getHandlers=function(t){for(var e=this.getRepoHandlers(t),n=t.command,r=t.status,i=0,o=this.domains.length;i<o;i++){var s=this.domains[i],a=s[0],p=s[1];if(p.register){var u=S(p.register(),n,r);u&&e.push(new W(a,p,u))}}return e},e.prototype.register=function(t){var e=t.type;return this.registry[e]||(this.registry[e]=this.getHandlers(t)),this.registry[e]},e.prototype.add=function(e,n,r){var i=y(n,r,this.repo),o=t(e);return this.domains.push([o,i]),this.registry={},i.setup&&i.setup(this.repo,r),i.teardown&&this.repo.on("teardown",i.teardown,i),i},e.prototype.reduce=function(t,e,n){for(var r=e,i=1,o=this.domains.length;i<o;i++){var s=this.domains[i],a=s[0],p=s[1];r=t.call(n,r,a,p)}return r},e.prototype.supportsKey=function(t){return t in this.repo.state||this.domains.some(function(e){return n(e[0])===t})},e.prototype.sanitize=function(t){var e=this.repo.parent,n={};for(var r in t)e&&e.domains.supportsKey(r)||this.supportsKey(r)&&(n[r]=t[r]);return n},e.prototype.dispatch=function(t,e){for(var n=this.register(e),r=t,i=0,o=n.length;i<o;i++){var s=n[i],u=s.key,h=s.domain,c=s.handler,f=a(t,u);r=p(t,u,c.call(h,f,e.payload))}return r},e.prototype.deserialize=function(t){return this.reduce(function(e,n,r){return r.deserialize?p(e,n,r.deserialize(a(t,n))):e},t)},e.prototype.serialize=function(t,e){return this.reduce(function(e,n,r){return r.serialize?p(e,n,r.serialize(a(t,n))):e},e)},e}(),Z=function(){function t(e){k(this,t),this.repo=e,this.effects=[]}return t.prototype.add=function(t,e){var n=y(t,e,this.repo);return n.setup&&n.setup(this.repo,e),n.teardown&&this.repo.on("teardown",n.teardown,n),this.effects.push(n),n},t.prototype.dispatch=function(t){for(var e=t.command,n=t.payload,r=t.status,i=0,o=this.effects.length;i<o;i++){var s=this.effects[i];if(s.register){var a=S(s.register(),e,r);a&&a.call(s,this.repo,n)}}},t}(),$=function(){function t(e,n,r){k(this,t),this.id=e,this.key=n,this.edges=[],this.parent=r||null,r&&r.connect(this)}return t.getId=function(t,e){return e&&e.id?e.id+"."+t:t},t.prototype.connect=function(t){t!==this&&this.edges.indexOf(t)<0&&this.edges.push(t)},t.prototype.disconnect=function(t){var e=this.edges.indexOf(t);~e&&this.edges.splice(e,1)},t.prototype.isAlone=function(){return this.edges.length<=0},t.prototype.orphan=function(){this.parent&&this.parent.disconnect(this)},t}(),tt=function(t){function e(n,r){k(this,e);var i=E(this,t.call(this));return i.id=n,i.keyPaths=r,i}return j(e,t),e.getId=function(t){return"query:"+r(t)},e.prototype.trigger=function(t){for(var e=["change"],n=0,r=this.keyPaths.length;n<r;n++)e[n+1]=a(t,this.keyPaths[n]);this._emit.apply(this,e)},e.prototype.isAlone=function(){return this._events.length<=0},e}(q),et="",nt=function(){function t(e){k(this,t),this.snapshot=e,this.nodes={},this.queries={}}return t.prototype.on=function(t,n,r){for(var i=e(t),o=this.addQuery(i),s=0,a=i.length;s<a;s++)this.addBranch(i[s],o);return o.on("change",n,r),o},t.prototype.off=function(t,n,r){var i=e(t),o=tt.getId(i),s=this.queries[o];s&&(s.off("change",n,r),s.isAlone()&&this.prune(s))},t.prototype.update=function(t){var e=this.snapshot;if(this.snapshot=t,this.nodes[et])for(var n=this.scan(this.nodes[et],e,t,[]),r=0;r<n.length;r++)n[r].trigger(t)},t.prototype.addNode=function(t,e){var n=$.getId(t,e);return this.nodes[n]||(this.nodes[n]=new $(n,t,e)),this.nodes[n]},t.prototype.addQuery=function(t){var e=tt.getId(t);return this.queries[e]||(this.queries[e]=new tt(e,t)),this.queries[e]},t.prototype.prune=function(t){for(var e=t.keyPaths.map(n),r=0,i=e.length;r<i;r++){var o=this.nodes[e[r]];o.disconnect(t);do{if(!o.isAlone())break;o.orphan(),delete this.nodes[o.id],o=o.parent}while(o)}delete this.queries[t.id]},t.prototype.addBranch=function(t,e){for(var n=this.addNode(et,null),r=0,i=t.length;r<i;r++)n=this.addNode(t[r],n);n.connect(e)},t.prototype.scan=function(t,e,n,r){if(e!==n)for(var i=t.edges,o=0,s=i.length;o<s;o++){var a=i[o];if(a instanceof tt&&r.indexOf(a)<0)r.push(a);else if(a instanceof $){var p=null==e?e:e[a.key],u=null==n?n:n[a.key];this.scan(a,p,u,r)}}return r},t}(),rt={maxHistory:0,parent:null,batch:!1},it=function(t){function e(n,r,i){k(this,e);var o=E(this,t.call(this)),a=s(rt,o.constructor.defaults,n||{});return o.parent=a.parent,o.initial=o.parent?o.parent.initial:o.getInitialState(),o.state=o.parent?o.parent.state:o.initial,o.history=o.parent?o.parent.history:new Q(a),o.archive=new F,o.domains=new Y(o),o.effects=new Z(o),o.changes=new nt(o.state),o.history.on("append",o.createSnapshot,o),o.history.on("update",o.updateSnapshot,o),o.history.on("remove",o.removeSnapshot,o),o.history.on("reconcile",o.dispatchEffect,o),o.history.on("release",o.release,o),o.setup(a),r&&o.reset(r,i),o}return j(e,t),e.prototype.setup=function(t){},e.prototype.teardown=function(){},e.prototype.getInitialState=function(){return null==this.initial?{}:this.initial},e.prototype.recall=function(t,e){return this.archive.get(t,e)},e.prototype.createSnapshot=function(t){this.archive.create(t)},e.prototype.updateSnapshot=function(t){var e=this.recall(t.parent,this.initial);this.parent&&(e=s(e,this.parent.recall(t))),t.disabled||(e=this.domains.dispatch(e,t)),this.archive.set(t,e),this.state=e},e.prototype.removeSnapshot=function(t){this.archive.remove(t)},e.prototype.dispatchEffect=function(t){this.effects.dispatch(t)},e.prototype.release=function(){this.changes.update(this.state)},e.prototype.on=function(t,e,n){var r=t.split(":",2),i=r[0],o=r[1];switch(i){case"change":this.changes.on(o||"",e,n);break;default:q.prototype.on.apply(this,arguments)}return this},e.prototype.off=function(t,e,n){var r=t.split(":",2),i=r[0],o=r[1];switch(i){case"change":this.changes.off(o||"",e,n);break;default:q.prototype.off.apply(this,arguments)}return this},e.prototype.append=function(t,e){return this.history.append(t,e)},e.prototype.push=function(t){for(var e=this.append(t),n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return w(e,t,r,this),e},e.prototype.prepare=function(t){for(var e=this,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return function(){for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return e.push.apply(e,[t].concat(r,i))}},e.prototype.addDomain=function(t,e,n){var r=this.domains.add(t,e,n);return r.getInitialState&&(this.initial=p(this.initial,t,r.getInitialState())),this.push(U,r),r},e.prototype.addEffect=function(t,e){return this.effects.add(t,e)},e.prototype.reset=function(t,e){return this.push(J,t,e)},e.prototype.patch=function(t,e){return this.push(G,t,e)},e.prototype.register=function(){return{}},e.prototype.deserialize=function(t){var e=t;return this.parent?e=this.parent.deserialize(t):"string"==typeof e&&(e=JSON.parse(e)),this.domains.deserialize(e)},e.prototype.serialize=function(){var t=this.parent?this.parent.serialize():{};return this.domains.serialize(this.state,t)},e.prototype.toJSON=function(){return this.serialize()},e.prototype.checkout=function(t){return this.history.checkout(t),this},e.prototype.fork=function(){return new e({parent:this})},e.prototype.shutdown=function(){this.teardown(),this._emit("teardown",this),this.history._removeScope(this),this.removeAllListeners()},e.prototype.parallel=function(t){return this.append("GROUP").link(t)},e}(q);exports.default=it,exports.Microcosm=it,exports.Action=T,exports.History=Q,exports.Emitter=q,exports.tag=g,exports.get=a,exports.set=p,exports.update=v,exports.merge=s,exports.getRegistration=S;
{
"name": "microcosm",
"version": "12.9.0-alpha",
"version": "12.9.0-beta",
"description": "Flux with actions at center stage. Write optimistic updates, cancel requests, and track changes with ease.",

@@ -21,4 +21,4 @@ "main": "microcosm.js",

"dependencies": {
"form-serialize": "0.7.1"
"form-serialize": "^0.7.2"
}
}
{
"name": "microcosm",
"version": "12.9.0-alpha",
"version": "12.9.0-beta",
"description": "Flux with actions at center stage. Write optimistic updates, cancel requests, and track changes with ease.",

@@ -21,4 +21,4 @@ "main": "microcosm.js",

"dependencies": {
"form-serialize": "0.7.1"
"form-serialize": "^0.7.2"
}
}

@@ -32,3 +32,3 @@ # [![Microcosm](http://code.viget.com/microcosm/assets/microcosm.svg)](http://code.viget.com/microcosm/)

// See http://code.viget.com/microcosm/api/actions.html
return axios(`/users/#{id}`)
return axios(`/users/${id}`)
}

@@ -283,5 +283,7 @@

return {
[action.open] : this.setPending,
[action.error] : this.setError,
[action.done] : this.addMessage
[send]: {
open: this.setPending,
error: this.setError,
done: this.addMessage
}
}

@@ -288,0 +290,0 @@ }

@@ -60,2 +60,5 @@ 'use strict';

/* istanbul ignore next */
var identity = function identity() {};
var ActionButton = function (_React$PureComponent) {

@@ -89,3 +92,3 @@ inherits(ActionButton, _React$PureComponent);

ActionButton.prototype.render = function render() {
var props = ___microcosm_js.merge({}, this.props, { onClick: this.click });
var props = ___microcosm_js.merge(this.props, { onClick: this.click });

@@ -113,3 +116,3 @@ delete props.tag;

ActionButton.contextTypes = {
send: function send() {}
send: identity
};

@@ -116,0 +119,0 @@ ActionButton.defaultProps = {

@@ -61,2 +61,5 @@ 'use strict';

/* istanbul ignore next */
var identity = function identity() {};
var ActionForm = function (_React$PureComponent) {

@@ -76,6 +79,6 @@ inherits(ActionForm, _React$PureComponent);

ActionForm.prototype.render = function render() {
var props = ___microcosm_js.merge({}, this.props, { ref: 'form', onSubmit: this.onSubmit });
var props = ___microcosm_js.merge(this.props, { ref: 'form', onSubmit: this.onSubmit }
// Remove invalid props to prevent React warnings
delete props.action;
);delete props.action;
delete props.prepare;

@@ -114,3 +117,3 @@ delete props.serializer;

ActionForm.contextTypes = {
send: function send() {}
send: identity
};

@@ -117,0 +120,0 @@ ActionForm.defaultProps = {

@@ -12,3 +12,2 @@ 'use strict';

* Shallow copy an object
* @private
*/

@@ -19,3 +18,2 @@

* Merge any number of objects into a provided object.
* @private
*/

@@ -25,13 +23,19 @@

/**
* Basic prototypal inheritence
* @private
* Retrieve a value from an object. If no key is provided, just return
* the object.
*/
function get$1(object, keyPath, fallback) {
var path = castPath(keyPath);
var value = object;
for (var i = 0, len = path.length; i < len; i++) {
if (value == null) {
break;
}
/**
* Retrieve a value from an object. If no key is provided, just return the
* object.
* @private
*/
value = value[path[i]];
}
return value == null ? fallback : value;
}

@@ -41,3 +45,2 @@ /**

* value is the same, don't do anything. Otherwise return a new object.
* @private
*/

@@ -48,5 +51,2 @@

* Is the provided object a promise?
* @param {*} obj
* @return {boolean}
* @private
*/

@@ -57,5 +57,2 @@

* Is a value an object?
* @param {*} target
* @return {boolean}
* @private
*/

@@ -66,32 +63,24 @@

* Is a value a function?
* @param {*} target
* @return {boolean}
* @private
*/
function isBlank(value) {
return value === '' || value === null || value === undefined;
}
/**
* Is a value a string?
* @param {*} target
* @return {boolean}
* @private
* Get the toStringTag symbol out of an object, with
* some legacy support.
*/
function isString(target) {
return typeof target === 'string';
}
/* istanbul ignore next */
var $Symbol = typeof Symbol === 'function' ? Symbol : {};
var toStringTagSymbol = get$1($Symbol, 'toStringTag', '@@toStringTag');
/**
* Is the provided value a generator function? This is largely
* informed by the regenerator runtime.
* @param {*} value
* @return {boolean}
* @private
*/
/**
* @private
*/

@@ -101,13 +90,10 @@

* A helper combination of get and set
* @param {Object} state
* @param {Array.<string>|string} keyPath
* @param {*} updater A function or static value
* @param {*} fallback value
* @private
*/
/**
* A key path is a list of property names that describe a pathway
* through a nested javascript object. For example, `['users', 2]`
* could represent a path within in `{ users: [{id: 0}, {id: 1}] }`
* @fileoverview A key path is a list of property names that describe
* a pathway through a nested javascript object. For example,
* `['users', 2]` could represent a path within in `{ users: [{id: 0},
* {id: 1}] }`
*
*/

@@ -118,10 +104,4 @@

function isBlank(value) {
return value === '' || value === null || value === undefined;
}
/**
* Ensure a value is a valid key path.
* @param {*} value Value to convert into a key path
* @return {Array} List of keys, like ['users', 2]
* @private

@@ -136,3 +116,3 @@ */

return isString(value) ? value.trim().split(KEY_DELIMETER) : [value];
return typeof value === 'string' ? value.trim().split(KEY_DELIMETER) : [value];
}

@@ -144,14 +124,10 @@

* subscription to multiple pathways in an object.
* @param {String|String[]} value Comma separated string or array
* @return {Array} List of paths, like [['users'], ['query', 'focus']]
* @private
*/
function getKeyPaths(value) {
var paths = value;
if (Array.isArray(value) === false) {
paths = ('' + paths).split(PATH_DELIMETER);
if (typeof value === 'string') {
return ('' + value).split(PATH_DELIMETER).map(castPath);
}
return paths.map(castPath);
return value.every(Array.isArray) ? value : value.map(castPath);
}

@@ -161,4 +137,2 @@

* Convert a key path into a string.
* @param {String[]} value List of keys, like ['query', 'focus']
* @return {String} Dot separated string, like 'query.focus'
* @private

@@ -170,4 +144,2 @@ */

* Convert a list of keys path into a string.
* @param {Array} array List of key paths, like [['users'], ['query', 'focus']]
* @return {Array} Comma key paths, like 'users,query.focus'
* @private

@@ -174,0 +146,0 @@ */

@@ -60,2 +60,3 @@ 'use strict';

* getModel function.
*
*/

@@ -82,6 +83,2 @@

/**
* @param {Microcosm} repo Track this Microcosm instance for updates
* @param {scope} scope Scope to invoke functional bindings
*/
function Model(repo, scope) {

@@ -104,4 +101,2 @@ classCallCheck(this, Model);

* Track an observable. Sending updates to a given key.
* @param {string} key
* @param {Observable} observable
*/

@@ -125,7 +120,2 @@

/**
* @param {Object} bindings A set of key/value pairs for building a model
*/
Model.prototype.bind = function bind(bindings) {

@@ -149,4 +139,2 @@ this.bindings = {};

* Update a specific model key. Emits a change event
* @param {string} key
* @param {*} value
*/

@@ -153,0 +141,0 @@

@@ -64,2 +64,3 @@ 'use strict';

* getModel function.
*
*/

@@ -86,6 +87,2 @@

/**
* @param {Microcosm} repo Track this Microcosm instance for updates
* @param {scope} scope Scope to invoke functional bindings
*/
function Model(repo, scope) {

@@ -108,4 +105,2 @@ classCallCheck(this, Model);

* Track an observable. Sending updates to a given key.
* @param {string} key
* @param {Observable} observable
*/

@@ -129,7 +124,2 @@

/**
* @param {Object} bindings A set of key/value pairs for building a model
*/
Model.prototype.bind = function bind(bindings) {

@@ -153,4 +143,2 @@ this.bindings = {};

* Update a specific model key. Emits a change event
* @param {string} key
* @param {*} value
*/

@@ -214,2 +202,3 @@

* manage application flow.
*
*/

@@ -221,9 +210,5 @@

/* istanbul ignore next */
var identity = function identity() {};
/**
* @class
* @extends React.PureComponent
*/
var Presenter = function (_React$PureComponent) {

@@ -266,3 +251,3 @@ inherits(Presenter, _React$PureComponent);

var givenRepo = this.props.repo || contextRepo;
var workingRepo = this.getRepo(givenRepo, this.props, this.state);
var workingRepo = this.getRepo(givenRepo, this.props);

@@ -277,5 +262,2 @@ this.didFork = workingRepo !== givenRepo;

* runs before the first `getModel` invocation.
* @param {Microcosm} repo
* @param {Object} props
* @param {Object} state
*/

@@ -292,5 +274,2 @@

* other start tasks that need access to the model data.
* @param {Microcosm} repo
* @param {Object} props
* @param {Object} state
*/

@@ -307,5 +286,2 @@ ;

* new information.
* @param {Microcosm} repo
* @param {Object} nextProps
* @param {Object} nextState
*/

@@ -321,5 +297,2 @@ ;

* subscriptions and other setup behavior.
* @param {Microcosm} repo
* @param {Object} props
* @param {Object} state
*/

@@ -358,4 +331,2 @@ ;

* Presenter forking behavior:
* @param {Microcosm} repo
* @param {Object} props
*/

@@ -376,11 +347,13 @@

* component.
* @param {Function|string} action
* @param {...*} params
*/
Presenter.prototype.send = function send() {
Presenter.prototype.send = function send(command) {
var _mediator;
return (_mediator = this.mediator).send.apply(_mediator, arguments);
for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
params[_key - 1] = arguments[_key];
}
return (_mediator = this.mediator).send.apply(_mediator, [command].concat(params));
};

@@ -391,4 +364,2 @@

* return an object of key/value pairs.
* @param {Object} presenterProps
* @param {Object} presenterState
*/

@@ -429,3 +400,3 @@

_this2.model.on('change', _this2.setState, _this2);
_this2.model.on('change', _this2.updateState, _this2);
return _this2;

@@ -437,3 +408,4 @@ }

repo: this.repo,
send: this.send
send: this.send,
parent: this
};

@@ -463,3 +435,3 @@ };

PresenterMediator.prototype.render = function render() {
// setState might have been called before the model
// setObject might have been called before the model
// can get assigned

@@ -478,2 +450,6 @@ this.presenter.model = this.state;

PresenterMediator.prototype.updateState = function updateState(state) {
this.setState(state);
};
PresenterMediator.prototype.updateModel = function updateModel(props, state) {

@@ -487,33 +463,35 @@ var bindings = this.presenter.getModel(props, state);

PresenterMediator.prototype.hasParent = function hasParent() {
// Do not allow transfer across repos. Check to for inheritence by comparing
// the common history object shared between repos
return Microcosm.get(this.repo, 'history') === Microcosm.get(this.context, ['repo', 'history']);
PresenterMediator.prototype.getParent = function getParent() {
return this.context.parent;
};
PresenterMediator.prototype.getHandler = function getHandler(intent) {
var interceptors = this.presenter.intercept
// A presenter's register goes through the same registration steps
();return Microcosm.getRegistration(interceptors, intent, 'resolve');
};
PresenterMediator.prototype.send = function send(intent) {
for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
params[_key - 1] = arguments[_key];
var _repo;
for (var _len2 = arguments.length, params = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
params[_key2 - 1] = arguments[_key2];
}
// tag intent first so the interceptor keys off the right key
var taggedIntent = Microcosm.tag(intent);
var mediator = this;
var interceptors = this.presenter.intercept();
while (mediator) {
var handler = mediator.getHandler(taggedIntent);
// A presenter's register goes through the same registration steps
var handler = Microcosm.getRegistration(interceptors, taggedIntent, 'resolve');
if (handler) {
return handler.call.apply(handler, [mediator, mediator.repo].concat(params));
}
// Does the presenter register to this intent?
if (handler) {
return handler.call.apply(handler, [this.presenter, this.repo].concat(params));
mediator = mediator.getParent();
}
// No: try the parent presenter
if (this.hasParent()) {
return this.context.send.apply(null, arguments);
}
// If we hit the top, push the intent into the Microcosm instance
return this.repo.push.apply(this.repo, arguments);
return (_repo = this.repo).push.apply(_repo, arguments);
};

@@ -526,9 +504,11 @@

repo: identity,
send: identity
send: identity,
parent: identity
};
PresenterMediator.childContextTypes = {
repo: identity,
send: identity
send: identity,
parent: identity
};
exports['default'] = Presenter;

@@ -10,2 +10,3 @@ 'use strict';

* Connect a component to the presenter tree
*
*/

@@ -12,0 +13,0 @@

{
"name": "microcosm",
"version": "12.9.0-alpha",
"version": "12.9.0-beta",
"description": "Flux with actions at center stage. Write optimistic updates, cancel requests, and track changes with ease.",

@@ -21,4 +21,4 @@ "main": "microcosm.js",

"dependencies": {
"form-serialize": "0.7.1"
"form-serialize": "^0.7.2"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display