UNPKG

mobx-create-stores

Version:

creates an object with MobX stores (+ links stores to routes)

20 lines (14 loc) 476 B
"use strict"; exports.__esModule = true; exports.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; }; module.exports = exports["default"];