UNPKG

mobx-location

Version:

minimal observable wrapper around browser location utilizing popstate event of HTML5 history api

11 lines (8 loc) 326 B
import makeMobxLocation from '../src/mobx-location' import { set, autorun, toJS } from 'mobx' window.mobxLocation = makeMobxLocation({ hashHistory: false }) // mobxLocation.hash = '#/aagg' // set(mobxLocation.query, { foo: new Date().toISOString() }) // autorun(() => { // console.log('autorun', toJS(mobxLocation)) // })