@reatom/npm-history
TypeScript icon, indicating that this package has built-in type declarations

3.1.6 • Public • Published

Installation

npm i @reatom/npm-history

Usage

You should setup historyAtom in the root of your app, before other dependent atoms will touch the ctx.

import { historyAtom } from '@reatom/npm-history'
import { createBrowserHistory } from 'history'

historyAtom(ctx, createBrowserHistory())
import { History, Location, To, Blocker } from 'history'

export interface HistoryAtom extends AtomMut<History> {
  back: Action<[]>
  block: Action<[blocker: Blocker], () => void>
  forward: Action<[]>
  go: Action<[delta: number]>
  location: Atom<Location>
  push: Action<[to: To, state?: any]>
  replace: Action<[to: To, state?: any]>
}

export const historyAtom: HistoryAtom

Readme

Keywords

none

Package Sidebar

Install

npm i @reatom/npm-history

Weekly Downloads

9

Version

3.1.6

License

MIT

Unpacked Size

24.4 kB

Total Files

8

Last publish

Collaborators

  • artalar