plandem / rrrouter-history

The simplest history session manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#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


Languages

Language:JavaScript 100.0%