hishim
v0.0.4
Published
History API shim for non-browser environments
Downloads
20
Maintainers
Readme
Hishim
History API Shim for non-browser env
Installation
npm i hishim
Usage
import History from 'hishim'
const history = new History({
handleBack(oldCurrent, newCurrent, next) {...},
handleForward(oldCurrent, newCurrent, next) {...},
handlePushState(oldCurrent, newCurrent, next) {...},
handleReplaceState(oldCurrent, newCurrent, next) {...}
})
interface CurrentState {
state: any, // your state
idx: number, // index of the current state
url: string, // url of this state
title: string, // page title of this state
prev: CurrentState, // previous state
next: Current // next state
}
License
MIT