0.2.8 • Published 3 years ago

@bearjam/tom v0.2.8

Weekly downloads
15
License
MIT
Repository
-
Last release
3 years ago

Usage

yarn add @bearjam/tom

import { withUndoableReducer } from "@bearjam/tom"

const initialState: State = {
  // ...
}

const reducer = (state: State, action: Action): State => {
  // ...
}

export const useCanvasStore = create(withUndoableReducer(reducer, initialState))

Then you can call this hook in your React app:

const [state, dispatch, undo, redo, canUndo, canRedo] = useCanvasStore(
  store => [
    store.state,
    store.dispatch,
    store.undo,
    store.redo,
    store.canUndo,
    store.canRedo,
  ],
  shallow
)
0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.1

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.4

3 years ago

0.2.0

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago