mobx-create-stores
Version:
creates an object with MobX stores (+ links stores to routes)
14 lines (11 loc) • 394 B
JavaScript
export default (function () {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
Store = _ref.Store,
_ref$history = _ref.history,
history = _ref$history === undefined ? false : _ref$history;
var store = new Store();
if (history && store.handleLocationChange) {
history.subscribe(store.handleLocationChange);
}
return store;
});