Skip to content

plandem/rrrouter-history

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

#Purpose Session manager for history.

#Installation

npm install --save rrrouter-history

#Implementations

Type Description
HashHistory Implements history session management based of hash part of url. Supported by old browsers.
BrowserHistory Implements history session management based of HTML5 History Api. Supported by modern browsers.

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

Method Description
subscribe(callback) Add a listener for changes, where callback is callback that will be called in case of inside changes. E.g.: go(-1)
unsubscribe Remove 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.

About

The simplest history session manager

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published