Skip to content
A simple front-end router with TypeScript and resolves.
TypeScript Shell JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
run Update README. Jan 13, 2019
src Rename isNavigationCalled to isNavigateCalled. Jun 16, 2019
tests Rename isNavigationCalled to isNavigateCalled. Jun 16, 2019
.gitignore Generate docs. Jan 13, 2019
.npmignore Generate docs. Jan 13, 2019
LICENSE Initial commit Apr 26, 2018
README.md Update README. Jan 13, 2019
index.js
package.json
preprocessor.js Add history and path-tree Apr 28, 2018
tsconfig.js Add history and path-tree Apr 28, 2018
tslint.json Add history and path-tree Apr 28, 2018
yarn.lock Bump handlebars from 4.1.2 to 4.5.3 Dec 28, 2019

README.md

Path Router

Path Router

Install

yarn add path-router-web
// or
npm install path-router-web

Usage

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);
    },
}]);

Docs

https://codetraceio.github.io/path-router/

Contribute

Install dependencies

yarn install

Lint

yarn lint

Test

yarn test
You can’t perform that action at this time.