@nent/core
Version:
30 lines (26 loc) • 622 B
JavaScript
/*!
* NENT 2022
*/
;
const index = require('./index-96f3ab3f.js');
/* istanbul ignore file */
const store = index.createStore({
router: null,
location: null,
hasExactRoute: false,
debug: false,
});
const { state, onChange, reset, dispose } = store;
let subscribed = false;
onChange('router', router => {
if (router && subscribed == false) {
router.eventBus.on('*', () => {
state.hasExactRoute = false;
state.location = router.location;
state.hasExactRoute = router.hasExactRoute();
});
subscribed = true;
}
});
exports.onChange = onChange;
exports.state = state;