The type of the value stored in each node
The number of steps to go back
The pathname and state that is the number of steps back from the current page
A serialized version of the browser history
The number of steps to go forward
The pathname and state that is steps steps forward from the current page
the current page's pathname and state
the homepage's pathname and state
A serialized version of the browser history
The page or pathname to visit
Generated using TypeDoc
A BrowserHistory class that implements a doubly linked list.
Example (es imports)
import { BrowserHistory } from 'spectrum-kit'; const history = new BrowserHistory('homepage'); history.visit('page1'); history.visit('page2', 'foo'); history.visit('page3', 'bar'); history.back(1); // => { pathname: 'page2', state: 'foo' } history.back(1); // => { pathname: 'page1', state: undefined } history.back(1); // => { pathname: 'homepage', state: undefined } history.forward(1); // => { pathname: 'page1', state: undefined } history.forward(1); // => { pathname: 'page2', state: 'foo' } history.forward(1); // => { pathname: 'page3', state: 'bar' }