1.1.2 • Published 7 years ago

rrrouter-history v1.1.2

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

#Purpose Session manager for history.

#Installation

npm install --save rrrouter-history

#Implementations

TypeDescription
HashHistoryImplements history session management based of hash part of url. Supported by old browsers.
BrowserHistoryImplements history session management based of HTML5 History Api. Supported by modern browsers.

#How to create own? Just create class that has following methods:

MethodDescription
subscribe(callback)Add a listener for changes, where callback is callback that will be called in case of inside changes. E.g.: go(-1)
unsubscribeRemove a listener
update(href,navigate)Update a history, where href is a new href and navigate is a flag about type of update: TRUE - navigate to a new location, FALSE - replace current location
go(page)Move forward/backward in browser history, where page is number of pages to move.