0.0.4 • Published 2 years ago

hishim v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago