UNPKG

mobx-create-stores

Version:

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

23 lines (17 loc) 728 B
'use strict'; exports.__esModule = true; var _reactRouter = require('react-router'); exports.default = function (_ref) { var _ref$stores = _ref.stores, stores = _ref$stores === undefined ? [] : _ref$stores, location = _ref.location, path = _ref.path, _ref$exact = _ref.exact, exact = _ref$exact === undefined ? false : _ref$exact, _ref$strict = _ref.strict, strict = _ref$strict === undefined ? false : _ref$strict, onMatch = _ref.onMatch; var match = (0, _reactRouter.matchPath)(location.pathname, { path: path, exact: exact, strict: strict }); if (match && onMatch) onMatch({ stores: stores, match: match, history: history }); }; module.exports = exports['default'];