3.1.6 • Published 10 months ago

@reatom/npm-history v3.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

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
3.1.6

10 months ago

3.1.5

1 year ago

3.1.4

1 year ago

3.1.3

1 year ago

3.1.2

1 year ago

3.1.0

1 year ago