hishim

0.0.4 • Public • Published

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

Package Sidebar

Install

npm i hishim

Weekly Downloads

3

Version

0.0.4

License

MIT

Unpacked Size

5.01 kB

Total Files

4

Last publish

Collaborators

  • classicoldsong