yarn add path-router-web
// or
npm install path-router-web
import { setHistoryOptions } from "path-router-web";
setHistoryOptions({
baseUrl: "https://test.com/",
});
addRouter([{
path: "something/:key1/:key2",
resolves: [() => "resolve value"],
loadingCallback: () => {
console.log("Loading started");
},
callback: (firstResolve: string) => {
console.log("Page loaded", firstResolve);
},
}]);
https://codetraceio.github.io/path-router/
Install dependencies
yarn install
Lint
yarn lint
Test
yarn test