Releases: udecode/jotai-x
Releases · udecode/jotai-x
[email protected]
Major Changes
- #17 by @yf-yang – 1. Rename
get
touseValue
,set
touseSet
,use
touseState
. 2.use<Name>Store().store()
->use<Name>Store().store
. 3.use<Name>Store().get.value(option)
anduse<Name>Store().set.value(option)
'soption
parameters are no longer supported. Pass the option touse<Name>Store()
instead. 4. Rename APIs:use<Name>Store().get.key()
->use<Name>Store().useKeyValue()
use<Name>Store().get.key()
->use<Name>Store().useValue('key')
use<Name>Store().set.key()
->use<Name>Store().useSetKey()
use<Name>Store().set.key()
->use<Name>Store().useSet('key')
use<Name>Store().use.key()
->use<Name>Store().useKeyState()
use<Name>Store().use.key()
->use<Name>Store().useState('key')
use<Name>Store().get.atom(atomConfig)
->use<Name>Store().useAtomValue(atomConfig)
use<Name>Store().set.atom(atomConfig)
->use<Name>Store().useSetAtom(atomConfig)
use<Name>Store().use.atom(atomConfig)
->use<Name>Store().useAtomState(atomConfig)
- More APIs to directly get/set/subscribe atom states:
use<Name>Store().getKey()
use<Name>Store().get('key')
use<Name>Store().setKey(...args)
use<Name>Store().set('key', ...args)
use<Name>Store().subscribeKey(...args)
use<Name>Store().subscribe('key', ...args)
use<Name>Store().getAtom(atomConfig)
use<Name>Store().setAtom(atomConfig, ...args)
use<Name>Store().subscribeAtom(atomConfig, ...args)
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Minor Changes
- #2 by @12joan –
- Atoms other than
atom
can now be passed in theinitialState
argument tocreateAtomStore
. Primitive values useatom
by default - Added an
extend
option tocreateAtomStore
that lets you add derived atoms to the store - New accessors on
UseStoreApi
useMyStore().store()
returns theJotaiStore
for the current context, or undefined if no store existsuseMyStore().{get,set,use}.atom(someAtom)
accessessomeAtom
through the store
- Types: remove exports for some internal types
GetRecord
SetRecord
UseRecord
- Atoms other than