0.1.0 • Published 1 year ago

tracked-history v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

NPM Package

Tracked History

BrowserHistory tracks browser history so that we can restore history stack with snapshots.

It was originally created for Boring Router to support complete lifecycle hooks while keeping browser navigation behavior right.

MemoryHistory and ReadOnlyHistory are also available for testing or server-side usages.

Installation

npm install tracked-history

Usage

import {BrowserHistory} from 'tracked-history';

const history = new BrowserHistory();

const snapshot = history.snapshot;

void history.push('/about');

void history.restore(snapshot);

License

MIT License.

0.1.0

1 year ago