0.1.0 • Published 3 years ago

@use-rematch/use v0.1.0

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

@use-rematch/use

useful recipes

npm

install

pnpm i @use-rematch/use

usage

basic

simple reducer model with basic set & update reducer.

import useStore from '@use-rematch/use/basic'

const { state, dispatch } = useStore({ dolphin: 1 })

// overwrite set
// from { dolphin: 1 } to { zoo: 1 }
dispatch.set({ zoo: 1 })

// partial update
// from { zoo: 1 } to { dolphin: 1, zoo: 1 }
dispatch.update({ dolphin: 1 })