0.0.4 • Published 5 months ago

hishim v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months 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

5 months ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago