Getting started
Installation
bash
npm install mobx-location-historybash
yarn add mobx-location-historybash
pnpm add mobx-location-historyUsage
ts
import {
createBrowserHistory,
createHashHistory,
createMemoryHistory,
createQueryParams,
} from "mobx-location-history";
import { reaction } from "mobx";
const history = createBrowserHistory();
reaction(
() => history.location,
(location) => {
console.log(location);
},
);
const queryParams = createQueryParams({
history,
});
reaction(
() => queryParams.data,
(queryParams) => {
console.log(queryParams);
},
);