mobx-location-history
v1.0.3
Published
## Observable browser [History](src/mobx-history/mobx-history.types.ts) and [Location](src/mobx-location/mobx-location.types.ts) interfaces + other utilities (like [QueryParams](src/query-params/query-params.types.ts))
Downloads
352
Readme
mobx-location-history
Observable browser History and Location interfaces + other utilities (like QueryParams)
import { reaction } from "mobx"
import { MobxHistory, MobxLocation, QueryParams } from "mobx-location-history";
const history = new MobxHistory()
const location = new MobxLocation(history);
const queryParams = new QueryParams(location, history);
reaction(() => location.href, href => {
// do things
})
history.pushState(null, '', '/home')
queryParams.set({
foo: 11,
bar: 'kek',
willBeRemoved: undefined,
})