@nent/core
Version:
27 lines (24 loc) • 597 B
JavaScript
/*!
* NENT 2022
*/
import { c as createStore } from './index-4bfabbbd.js';
/* istanbul ignore file */
const store = 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;
}
});
export { onChange as o, state as s };