0.0.3 • Published 9 months ago

kkstore v0.0.3

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

kkstore

react light weight data share store, with strict type.

Usage

See ``demo`` directory for more usage.

// /src/store/somestore.ts
import kkstore from 'kkstore';
const { useStore } = kkstore({
  a: 10,
  b: 'hello',
});
export { useStore };

// /src/app/pages/somecomponent.tsx
import { useStore } from '@/store/somestore.ts';
const [a, setA] = useStore('a'); //
setA('ok'); // bad. compile error, type of a must be number
setA(10); // ok
const [c] = useStore('c'); // bad. compile error, somestore has no propery named c
0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago