0.0.4 • Published 1 year ago
@icraft/store v0.0.4
@icraft/store
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
1 year ago
0.0.3-alpha.18
1 year ago
0.0.3-alpha.17
1 year ago
0.0.3-alpha.16
1 year ago
0.0.3-alpha.15
1 year ago
0.0.3-alpha.12
1 year ago
0.0.3-alpha.9
1 year ago
0.0.3-alpha.8
1 year ago
0.0.3-alpha.7
1 year ago
0.0.3-alpha.6
1 year ago
0.0.3-alpha.5
1 year ago
0.0.3-alpha.4
1 year ago
0.0.3-alpha.3
1 year ago
0.0.3-alpha.0
1 year ago
0.0.2
1 year ago
0.0.1
1 year ago