An improved HTML5 History API to achieve more, with less headaches.
npm install storicuIt is designed to follow the native HTML5 History API and add new features
(access to full state history, additional parameters on popstate, clear
forward history, ...).
storicu.replaceState(state, title, url)storicu.pushState(state, title, url)storicu.go(delta)storicu.forward(distance)storicu.back(distance)In addition, Storicu provides additional methods to simplify history
management :
- storicu.cleanForwardHistory()
- storicu.getStates() To come
- storicu.getStateIndex()
Storicu also introduces a new callback storicu.onpopstate to replacewindow.onpopstate :
- storicu.onpopstate = ({state}, delta, triggeredByAPI) => {...}
For Storicu to work properly, you should not use the native HTML5 History API,
but instead rely on Storicu's implementation of these methods and callbacks.