0.0.4 • Published 11 months ago

@icraft/store v0.0.4

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

@icraft/store

NPM version NPM downloads

This is a general and very, very easy to use data flow management tool

Install

pnpm i @icraft/store -S

Usage

// create a store in any where
import { Store } from '@icraft/store'

const store = new Store({
  count:0,
  name:'name'
})

// set state in any where
store.setState({
  count:1,
  name:'new name'
})
// use the store in component
import { useStore } from '@icraft/store'

const [{count,name},setState] = useStore(store,['count','name'])

// update state in component
const handleClick = () => {
  setState({
    count:count+1,
  })
}

LICENSE

MIT license.

0.0.4

11 months ago

0.0.3-alpha.18

11 months ago

0.0.3-alpha.17

11 months ago

0.0.3-alpha.16

11 months ago

0.0.3-alpha.15

11 months ago

0.0.3-alpha.12

11 months ago

0.0.3-alpha.9

12 months ago

0.0.3-alpha.8

12 months ago

0.0.3-alpha.7

12 months ago

0.0.3-alpha.6

12 months ago

0.0.3-alpha.5

12 months ago

0.0.3-alpha.4

12 months ago

0.0.3-alpha.3

12 months ago

0.0.3-alpha.0

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago