Package @reatom/primitives
@reatom/primitives
Interfaces
ArrayAtom()<T>
Defined in: primitives/reatomArray.ts:4
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Extends
Atom<T[]>
Type Parameters
T
T
The type of state stored in the atom
ArrayAtom(…
params):T[]
Defined in: primitives/reatomArray.ts:4
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Parameters
params
…[]
Parameters to pass to the atom
Returns
T[]
The atom’s payload (typically its current state)
Properties
__reatom
__reatom:
AtomMeta
Defined in: core/atom.ts:106
Reference to the atom’s internal metadata.
Inherited from
actions
Defined in: core/atom.ts:86
Bind methods to the atom to extend its functionality.
Deprecated
Use extend instead
Inherited from
extend
Defined in: core/atom.ts:92
Extension system to add capabilities to atoms. Allows adding middleware, methods, or other functionality to modify atom behavior.
Inherited from
pop
pop:
Action<[],undefined|T>
Defined in: primitives/reatomArray.ts:6
push
push:
Action<T[],number>
Defined in: primitives/reatomArray.ts:5
shift
shift:
Action<[],undefined|T>
Defined in: primitives/reatomArray.ts:7
subscribe()
subscribe: (
cb?) =>Unsubscribe
Defined in: core/atom.ts:103
Subscribe to state changes, with the first call happening immediately. When a subscriber is added, the callback is immediately invoked with the current state. After that, it’s called whenever the atom’s state changes.
Parameters
cb?
(state) => any
Callback function that receives the atom’s state when it changes
Returns
An unsubscribe function that removes the subscription when called
Inherited from
unshift
unshift:
Action<T[],number>
Defined in: primitives/reatomArray.ts:8
Methods
set()
Call Signature
set(
update):T[]
Defined in: core/atom.ts:127
Update the atom’s state using a function that receives the previous state
Parameters
update
(state) => T[]
Function that takes the current state and returns a new state
Returns
T[]
The new state value
Inherited from
Call Signature
set(…
params):T[]
Defined in: core/atom.ts:135
Set the atom’s state to a new value
Parameters
params
…[T[]]
Returns
T[]
The new state value
Inherited from
BooleanAtom()
Defined in: primitives/reatomBoolean.ts:4
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Extends
Atom<boolean>
BooleanAtom(…
params):boolean
Defined in: primitives/reatomBoolean.ts:4
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Parameters
params
…[]
Parameters to pass to the atom
Returns
boolean
The atom’s payload (typically its current state)
Properties
__reatom
__reatom:
AtomMeta
Defined in: core/atom.ts:106
Reference to the atom’s internal metadata.
Inherited from
actions
actions:
Actions<BooleanAtom>
Defined in: core/atom.ts:86
Bind methods to the atom to extend its functionality.
Deprecated
Use extend instead
Inherited from
extend
extend:
Extend<BooleanAtom>
Defined in: core/atom.ts:92
Extension system to add capabilities to atoms. Allows adding middleware, methods, or other functionality to modify atom behavior.
Inherited from
reset
reset:
Action<[],boolean>
Defined in: primitives/reatomBoolean.ts:8
setFalse
setFalse:
Action<[],false>
Defined in: primitives/reatomBoolean.ts:7
setTrue
setTrue:
Action<[],true>
Defined in: primitives/reatomBoolean.ts:6
subscribe()
subscribe: (
cb?) =>Unsubscribe
Defined in: core/atom.ts:103
Subscribe to state changes, with the first call happening immediately. When a subscriber is added, the callback is immediately invoked with the current state. After that, it’s called whenever the atom’s state changes.
Parameters
cb?
(state) => any
Callback function that receives the atom’s state when it changes
Returns
An unsubscribe function that removes the subscription when called
Inherited from
toggle
toggle:
Action<[],boolean>
Defined in: primitives/reatomBoolean.ts:5
Methods
set()
Call Signature
set(
update):boolean
Defined in: core/atom.ts:127
Update the atom’s state using a function that receives the previous state
Parameters
update
(state) => boolean
Function that takes the current state and returns a new state
Returns
boolean
The new state value
Inherited from
Call Signature
set(…
params):boolean
Defined in: core/atom.ts:135
Set the atom’s state to a new value
Parameters
params
…[boolean]
Returns
boolean
The new state value
Inherited from
LinkedList<Node>
Defined in: primitives/reatomLinkedList.ts:30
Extended by
Type Parameters
Node
Properties
changes
changes:
LLChanges<Node>[]
Defined in: primitives/reatomLinkedList.ts:35
head
head:
null|Node
Defined in: primitives/reatomLinkedList.ts:31
size
size:
number
Defined in: primitives/reatomLinkedList.ts:33
tail
tail:
null|Node
Defined in: primitives/reatomLinkedList.ts:32
version
version:
number
Defined in: primitives/reatomLinkedList.ts:34
LinkedListAtom()<Params, Node, Key>
Defined in: primitives/reatomLinkedList.ts:45
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Extends
LinkedListLikeAtom<LinkedList<LLNode<Node>>>
Type Parameters
Params
Params extends any[] = any[]
The type of state stored in the atom
Node
Key
Key extends keyof Node = never
LinkedListAtom(…
params):LinkedList
Defined in: primitives/reatomLinkedList.ts:45
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Parameters
params
…[]
Parameters to pass to the atom
Returns
The atom’s payload (typically its current state)
Properties
__reatom
__reatom:
AtomMeta
Defined in: core/atom.ts:106
Reference to the atom’s internal metadata.
Inherited from
__reatomLinkedList
__reatomLinkedList:
true
Defined in: primitives/reatomLinkedList.ts:42
Inherited from
LinkedListLikeAtom.__reatomLinkedList
actions
actions:
Actions<LinkedListAtom<Params,Node,Key>>
Defined in: core/atom.ts:86
Bind methods to the atom to extend its functionality.
Deprecated
Use extend instead
Inherited from
array
Defined in: primitives/reatomLinkedList.ts:40
Inherited from
batch
Defined in: primitives/reatomLinkedList.ts:50
clear
clear:
Action<[],void>
Defined in: primitives/reatomLinkedList.ts:56
create
Defined in: primitives/reatomLinkedList.ts:52
extend
extend:
Extend<LinkedListAtom<Params,Node,Key>>
Defined in: core/atom.ts:92
Extension system to add capabilities to atoms. Allows adding middleware, methods, or other functionality to modify atom behavior.
Inherited from
find()
find: (
cb) =>null|LLNode<Node>
Defined in: primitives/reatomLinkedList.ts:58
Parameters
cb
(node) => boolean
Returns
null | LLNode<Node>
initiateFromSnapshot()
initiateFromSnapshot: (
initSnapshot) =>LinkedList<LLNode<Node>>
Defined in: primitives/reatomLinkedList.ts:67
Parameters
initSnapshot
Params[]
Returns
LinkedList<LLNode<Node>>
initiateFromState()
initiateFromState: (
initState) =>LinkedList<LLNode<Node>>
Defined in: primitives/reatomLinkedList.ts:66
Parameters
initState
Node[]
Returns
LinkedList<LLNode<Node>>
map
map:
Keyextendsnever?never:Atom<Map<State<Node[Key]>,LLNode<Node>>, [Map<State<Node[Key]>,LLNode<Node>>]>
Defined in: primitives/reatomLinkedList.ts:64
This lazy map is useful for working with serializable identifier, but it is not recommended to use it for large (thousands elements) lists
move
Defined in: primitives/reatomLinkedList.ts:55
reatomMap()
reatomMap: <
T>(cb,options?) =>LinkedListDerivedAtom<LLNode<Node>,LLNode<T>>
Defined in: primitives/reatomLinkedList.ts:71
Type Parameters
T
T extends Rec
Parameters
cb
(node) => T
options?
string | { name?: string; onClear?: (lastState) => void; onCreate?: (node) => void; onMove?: (node) => void; onRemove?: (node, origin) => void; onSwap?: (payload) => void; }
Returns
LinkedListDerivedAtom<LLNode<Node>, LLNode<T>>
remove
Defined in: primitives/reatomLinkedList.ts:53
subscribe()
subscribe: (
cb?) =>Unsubscribe
Defined in: core/atom.ts:103
Subscribe to state changes, with the first call happening immediately. When a subscriber is added, the callback is immediately invoked with the current state. After that, it’s called whenever the atom’s state changes.
Parameters
cb?
(state) => any
Callback function that receives the atom’s state when it changes
Returns
An unsubscribe function that removes the subscription when called
Inherited from
swap
Defined in: primitives/reatomLinkedList.ts:54
Methods
set()
Call Signature
set(
update):LinkedList
Defined in: core/atom.ts:127
Update the atom’s state using a function that receives the previous state
Parameters
update
(state) => LinkedList
Function that takes the current state and returns a new state
Returns
The new state value
Inherited from
Call Signature
set(…
params):LinkedList
Defined in: core/atom.ts:135
Set the atom’s state to a new value
Parameters
params
…[LinkedList<LLNode<Node>>]
Returns
The new state value
Inherited from
LinkedListDerivedAtom()<Node, T>
Defined in: primitives/reatomLinkedList.ts:108
Derived state container.
A computed atom automatically tracks dependencies and recalculates only when those dependencies change. The calculation is performed lazily, only when the computed value is read AND subscribed to.
Extends
Computed<LinkedListDerivedState<Node,T>>
Type Parameters
Node
Node extends LLNode
The type of derived state
T
T extends LLNode
LinkedListDerivedAtom(…
params):LinkedListDerivedState
Defined in: primitives/reatomLinkedList.ts:108
Derived state container.
A computed atom automatically tracks dependencies and recalculates only when those dependencies change. The calculation is performed lazily, only when the computed value is read AND subscribed to.
Parameters
params
…[]
Parameters to pass to the atom
Returns
The atom’s payload (typically its current state)
Properties
__reatom
__reatom:
AtomMeta
Defined in: core/atom.ts:106
Reference to the atom’s internal metadata.
Inherited from
__reatomLinkedList
__reatomLinkedList:
true
Defined in: primitives/reatomLinkedList.ts:112
actions
actions:
Actions<LinkedListDerivedAtom<Node,T>>
Defined in: core/atom.ts:86
Bind methods to the atom to extend its functionality.
Deprecated
Use extend instead
Inherited from
array
array:
Computed<TextendsLinkedList<LLNode> ?LLNode:never[]>
Defined in: primitives/reatomLinkedList.ts:110
extend
extend:
Extend<LinkedListDerivedAtom<Node,T>>
Defined in: core/atom.ts:92
Extension system to add capabilities to atoms. Allows adding middleware, methods, or other functionality to modify atom behavior.
Inherited from
set
set:
unknown
Defined in: core/atom.ts:79
Inherited from
subscribe()
subscribe: (
cb?) =>Unsubscribe
Defined in: core/atom.ts:103
Subscribe to state changes, with the first call happening immediately. When a subscriber is added, the callback is immediately invoked with the current state. After that, it’s called whenever the atom’s state changes.
Parameters
cb?
(state) => any
Callback function that receives the atom’s state when it changes
Returns
An unsubscribe function that removes the subscription when called
Inherited from
LinkedListDerivedState<Node, T>
Defined in: primitives/reatomLinkedList.ts:103
Extends
LinkedList<T>
Type Parameters
Node
Node extends LLNode
T
T extends LLNode
Properties
changes
changes:
LLChanges<T>[]
Defined in: primitives/reatomLinkedList.ts:35
Inherited from
head
head:
null|T
Defined in: primitives/reatomLinkedList.ts:31
Inherited from
map
map:
WeakMap<Node,T>
Defined in: primitives/reatomLinkedList.ts:105
size
size:
number
Defined in: primitives/reatomLinkedList.ts:33
Inherited from
tail
tail:
null|T
Defined in: primitives/reatomLinkedList.ts:32
Inherited from
version
version:
number
Defined in: primitives/reatomLinkedList.ts:34
Inherited from
LinkedListLikeAtom()<T>
Defined in: primitives/reatomLinkedList.ts:38
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Extends
Atom<T>
Extended by
Type Parameters
T
T extends LinkedList = LinkedList
The type of state stored in the atom
LinkedListLikeAtom(…
params):T
Defined in: primitives/reatomLinkedList.ts:38
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Parameters
params
…[]
Parameters to pass to the atom
Returns
T
The atom’s payload (typically its current state)
Properties
__reatom
__reatom:
AtomMeta
Defined in: core/atom.ts:106
Reference to the atom’s internal metadata.
Inherited from
__reatomLinkedList
__reatomLinkedList:
true
Defined in: primitives/reatomLinkedList.ts:42
actions
actions:
Actions<LinkedListLikeAtom<T>>
Defined in: core/atom.ts:86
Bind methods to the atom to extend its functionality.
Deprecated
Use extend instead
Inherited from
array
array:
Computed<TextendsLinkedList<LLNode> ?LLNode:never[]>
Defined in: primitives/reatomLinkedList.ts:40
extend
extend:
Extend<LinkedListLikeAtom<T>>
Defined in: core/atom.ts:92
Extension system to add capabilities to atoms. Allows adding middleware, methods, or other functionality to modify atom behavior.
Inherited from
subscribe()
subscribe: (
cb?) =>Unsubscribe
Defined in: core/atom.ts:103
Subscribe to state changes, with the first call happening immediately. When a subscriber is added, the callback is immediately invoked with the current state. After that, it’s called whenever the atom’s state changes.
Parameters
cb?
(state) => any
Callback function that receives the atom’s state when it changes
Returns
An unsubscribe function that removes the subscription when called
Inherited from
Methods
set()
Call Signature
set(
update):T
Defined in: core/atom.ts:127
Update the atom’s state using a function that receives the previous state
Parameters
update
(state) => T
Function that takes the current state and returns a new state
Returns
T
The new state value
Inherited from
Call Signature
set(…
params):T
Defined in: core/atom.ts:135
Set the atom’s state to a new value
Parameters
params
…[T]
Returns
T
The new state value
Inherited from
MapAtom()<Key, Value>
Defined in: primitives/reatomMap.ts:11
Base atom interface for other userspace implementations. This is the core interface that all atom-like objects implement, providing the foundation for Reatom’s reactivity system.
Extends
AtomLike<Map<Key,Value>, []>
Type Parameters
Key
Key
The type of state stored in the atom
Value
Value
MapAtom(…
params):Map
Defined in: primitives/reatomMap.ts:11
Base atom interface for other userspace implementations. This is the core interface that all atom-like objects implement, providing the foundation for Reatom’s reactivity system.
Parameters
params
…[]
Parameters to pass to the atom
Returns
Map
The atom’s payload (typically its current state)
Properties
__reatom
__reatom:
AtomMeta
Defined in: core/atom.ts:106
Reference to the atom’s internal metadata.
Inherited from
actions
Defined in: core/atom.ts:86
Bind methods to the atom to extend its functionality.
Deprecated
Use extend instead
Inherited from
clear
clear:
Action<[],Map<Key,Value>>
Defined in: primitives/reatomMap.ts:35
delete
delete:
Action<[Key],Map<Key,Value>>
Defined in: primitives/reatomMap.ts:34
extend
Defined in: core/atom.ts:92
Extension system to add capabilities to atoms. Allows adding middleware, methods, or other functionality to modify atom behavior.
Inherited from
getOrCreate()
getOrCreate: (
key,creator) =>Value
Defined in: primitives/reatomMap.ts:31
Parameters
key
Key
creator
() => Value
Returns
Value
reset
reset:
Action<[],Map<Key,Value>>
Defined in: primitives/reatomMap.ts:36
set
set:
Action<[Key,Value],Map<Key,Value>>
Defined in: primitives/reatomMap.ts:33
Overrides
size
size:
Computed<number>
Defined in: primitives/reatomMap.ts:38
subscribe()
subscribe: (
cb?) =>Unsubscribe
Defined in: core/atom.ts:103
Subscribe to state changes, with the first call happening immediately. When a subscriber is added, the callback is immediately invoked with the current state. After that, it’s called whenever the atom’s state changes.
Parameters
cb?
(state) => any
Callback function that receives the atom’s state when it changes
Returns
An unsubscribe function that removes the subscription when called
Inherited from
Methods
setState()
Call Signature
setState(
update):Map<Key,Value>
Defined in: primitives/reatomMap.ts:19
Update the atom’s state using a function that receives the previous state
Parameters
update
(state) => StateInit<Key, Value>
Function that takes the current state and returns a new state
Returns
Map<Key, Value>
The new state value
Call Signature
setState(
newState):Map<Key,Value>
Defined in: primitives/reatomMap.ts:29
Set the atom’s state to a new value
Parameters
newState
StateInit<Key, Value>
The new state value
Returns
Map<Key, Value>
The new state value
NumberAtom()
Defined in: primitives/reatomNumber.ts:5
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Extends
Atom<number>
NumberAtom(…
params):number
Defined in: primitives/reatomNumber.ts:5
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Parameters
params
…[]
Parameters to pass to the atom
Returns
number
The atom’s payload (typically its current state)
Properties
__reatom
__reatom:
AtomMeta
Defined in: core/atom.ts:106
Reference to the atom’s internal metadata.
Inherited from
actions
actions:
Actions<NumberAtom>
Defined in: core/atom.ts:86
Bind methods to the atom to extend its functionality.
Deprecated
Use extend instead
Inherited from
decrement
decrement:
Action<[number],number>
Defined in: primitives/reatomNumber.ts:7
extend
extend:
Extend<NumberAtom>
Defined in: core/atom.ts:92
Extension system to add capabilities to atoms. Allows adding middleware, methods, or other functionality to modify atom behavior.
Inherited from
increment
increment:
Action<[number],number>
Defined in: primitives/reatomNumber.ts:6
random
random:
Action<[number,number],number>
Defined in: primitives/reatomNumber.ts:8
reset
reset:
Action<[],number>
Defined in: primitives/reatomNumber.ts:9
subscribe()
subscribe: (
cb?) =>Unsubscribe
Defined in: core/atom.ts:103
Subscribe to state changes, with the first call happening immediately. When a subscriber is added, the callback is immediately invoked with the current state. After that, it’s called whenever the atom’s state changes.
Parameters
cb?
(state) => any
Callback function that receives the atom’s state when it changes
Returns
An unsubscribe function that removes the subscription when called
Inherited from
Methods
set()
Call Signature
set(
update):number
Defined in: core/atom.ts:127
Update the atom’s state using a function that receives the previous state
Parameters
update
(state) => number
Function that takes the current state and returns a new state
Returns
number
The new state value
Inherited from
Call Signature
set(…
params):number
Defined in: core/atom.ts:135
Set the atom’s state to a new value
Parameters
params
…[number]
Returns
number
The new state value
Inherited from
RecordAtom()<T>
Defined in: primitives/reatomRecord.ts:6
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Extends
Atom<T>
Type Parameters
T
T extends Rec
The type of state stored in the atom
RecordAtom(…
params):T
Defined in: primitives/reatomRecord.ts:6
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Parameters
params
…[]
Parameters to pass to the atom
Returns
T
The atom’s payload (typically its current state)
Properties
__reatom
__reatom:
AtomMeta
Defined in: core/atom.ts:106
Reference to the atom’s internal metadata.
Inherited from
actions
actions:
Actions<RecordAtom<T>>
Defined in: core/atom.ts:86
Bind methods to the atom to extend its functionality.
Deprecated
Use extend instead
Inherited from
extend
extend:
Extend<RecordAtom<T>>
Defined in: core/atom.ts:92
Extension system to add capabilities to atoms. Allows adding middleware, methods, or other functionality to modify atom behavior.
Inherited from
merge
merge:
Action<[Partial<T>],T>
Defined in: primitives/reatomRecord.ts:7
omit
omit:
Action<keyofT[],T>
Defined in: primitives/reatomRecord.ts:8
reset
reset:
Action<keyofT[],T>
Defined in: primitives/reatomRecord.ts:9
subscribe()
subscribe: (
cb?) =>Unsubscribe
Defined in: core/atom.ts:103
Subscribe to state changes, with the first call happening immediately. When a subscriber is added, the callback is immediately invoked with the current state. After that, it’s called whenever the atom’s state changes.
Parameters
cb?
(state) => any
Callback function that receives the atom’s state when it changes
Returns
An unsubscribe function that removes the subscription when called
Inherited from
Methods
set()
Call Signature
set(
update):T
Defined in: core/atom.ts:127
Update the atom’s state using a function that receives the previous state
Parameters
update
(state) => T
Function that takes the current state and returns a new state
Returns
T
The new state value
Inherited from
Call Signature
set(…
params):T
Defined in: core/atom.ts:135
Set the atom’s state to a new value
Parameters
params
…[T]
Returns
T
The new state value
Inherited from
SetAtom()<T>
Defined in: primitives/reatomSet.ts:8
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Extends
Atom<Set<T>, [StateInit<T>]>
Type Parameters
T
T
The type of state stored in the atom
SetAtom(…
params):Set
Defined in: primitives/reatomSet.ts:8
Base changeable state container.
Atom is the core primitive for storing and updating mutable state in Reatom. It can be called to retrieve its current state or update it with a new value or update function.
Parameters
params
…[]
Parameters to pass to the atom
Returns
Set
The atom’s payload (typically its current state)
Properties
__reatom
__reatom:
AtomMeta
Defined in: core/atom.ts:106
Reference to the atom’s internal metadata.
Inherited from
actions
Defined in: core/atom.ts:86
Bind methods to the atom to extend its functionality.
Deprecated
Use extend instead
Inherited from
add
add:
Action<[T],Set<T>>
Defined in: primitives/reatomSet.ts:9
clear
clear:
Action<[],Set<T>>
Defined in: primitives/reatomSet.ts:12
delete
delete:
Action<[T],Set<T>>
Defined in: primitives/reatomSet.ts:10
extend
Defined in: core/atom.ts:92
Extension system to add capabilities to atoms. Allows adding middleware, methods, or other functionality to modify atom behavior.
Inherited from
reset
reset:
Action<[],Set<T>>
Defined in: primitives/reatomSet.ts:13
size
size:
Computed<number>
Defined in: primitives/reatomSet.ts:14
subscribe()
subscribe: (
cb?) =>Unsubscribe
Defined in: core/atom.ts:103
Subscribe to state changes, with the first call happening immediately. When a subscriber is added, the callback is immediately invoked with the current state. After that, it’s called whenever the atom’s state changes.
Parameters
cb?
(state) => any
Callback function that receives the atom’s state when it changes
Returns
An unsubscribe function that removes the subscription when called
Inherited from
toggle
toggle:
Action<[T],Set<T>>
Defined in: primitives/reatomSet.ts:11
Methods
set()
Call Signature
set(
update):Set
Defined in: core/atom.ts:127
Update the atom’s state using a function that receives the previous state
Parameters
update
(state) => Set
Function that takes the current state and returns a new state
Returns
Set
The new state value
Inherited from
Call Signature
set(…
params):Set
Defined in: core/atom.ts:135
Set the atom’s state to a new value
Parameters
params
…[StateInit<T>]
Returns
Set
The new state value
Inherited from
Type Aliases
EnumAtom<T, Format>
EnumAtom<
T,Format> =Atom<T> &EnumVariantSetters<T,Format> &object
Defined in: primitives/reatomEnum.ts:15
Type declaration
enum
enum:
{ [K in T]: K }
reset
reset:
Action<[],T>
Type Parameters
T
T extends string
Format
Format extends EnumFormat = "camelCase"
EnumAtomOptions<T, Format>
EnumAtomOptions<
T,Format> =object
Defined in: primitives/reatomEnum.ts:24
Type Parameters
T
T extends string
Format
Format extends EnumFormat = "camelCase"
Properties
format?
optionalformat:Format
Defined in: primitives/reatomEnum.ts:29
initState?
optionalinitState:T
Defined in: primitives/reatomEnum.ts:30
name?
optionalname:string
Defined in: primitives/reatomEnum.ts:28
EnumFormat
EnumFormat =
"camelCase"|"snake_case"
Defined in: primitives/reatomEnum.ts:5
LLNode<T>
LLNode<
T> =T&object
Defined in: primitives/reatomLinkedList.ts:18
Linked List is reusing the model reference to simplify the reference sharing and using it as a key of LL methods. Btw, symbols works fine with serialization and will not add a garbage to an output.
Type declaration
[LL_NEXT]
[LL_NEXT]:
null|LLNode<T>
[LL_PREV]
[LL_PREV]:
null|LLNode<T>
Type Parameters
T
StringAtom<T>
StringAtom<
T> =Atom<T> &object
Defined in: primitives/reatomString.ts:4
Type declaration
reset
reset:
Action<[],T>
Type Parameters
T
T extends string = string
Variables
reatomString()
constreatomString: {(init?,name?):StringAtom; <T>(init,name?):StringAtom<T>; }
Defined in: primitives/reatomString.ts:8
Call Signature
(
init?,name?):StringAtom
Parameters
init?
string
name?
string
Returns
Call Signature
<
T>(init,name?):StringAtom<T>
Type Parameters
T
T extends string
Parameters
init
T
name?
string
Returns
StringAtom<T>
Functions
isLinkedListAtom()
isLinkedListAtom(
thing):thing is LinkedListLikeAtom<LinkedList<LLNode<Rec>>>
Defined in: primitives/reatomLinkedList.ts:740
Parameters
thing
any
Returns
thing is LinkedListLikeAtom<LinkedList<LLNode<Rec>>>
reatomArray()
reatomArray<
T>(initState,name):ArrayAtom<T>
Defined in: primitives/reatomArray.ts:11
Type Parameters
T
T
Parameters
initState
T[] = ...
name
string = ...
Returns
ArrayAtom<T>
reatomBoolean()
reatomBoolean(
init,name):BooleanAtom
Defined in: primitives/reatomBoolean.ts:11
Parameters
init
boolean = false
name
string = ...
Returns
reatomEnum()
reatomEnum<
T,Format>(variants,options):EnumAtom<T,Format>
Defined in: primitives/reatomEnum.ts:33
Type Parameters
T
T extends string
Format
Format extends "camelCase" | "snake_case" = "camelCase"
Parameters
variants
readonly T[]
options
string | EnumAtomOptions<T, Format>
Returns
EnumAtom<T, Format>
reatomLinkedList()
Call Signature
reatomLinkedList<
Node,Params,Key>(initState,name?):LinkedListAtom<Params,Node,Key>
Defined in: primitives/reatomLinkedList.ts:252
Type Parameters
Node
Node extends Rec
Params
Params extends any[] = [Node]
Key
Key extends string | number | symbol = never
Parameters
initState
Node[]
name?
string
Returns
LinkedListAtom<Params, Node, Key>
Call Signature
reatomLinkedList<
Params,Node,Key>(initState,name?):LinkedListAtom<Params,Node,Key>
Defined in: primitives/reatomLinkedList.ts:258
Type Parameters
Params
Params extends any[]
Node
Node extends Rec
Key
Key extends string | number | symbol = never
Parameters
initState
(…params) => Node
name?
string
Returns
LinkedListAtom<Params, Node, Key>
Call Signature
reatomLinkedList<
Params,Node,Key>(initState,name?):LinkedListAtom<Params,Node,Key>
Defined in: primitives/reatomLinkedList.ts:267
Type Parameters
Params
Params extends any[]
Node
Node extends Rec
Key
Key extends string | number | symbol = never
Parameters
initState
create
(…params) => Node
initState?
Node[]
key?
Key
name?
string
Returns
LinkedListAtom<Params, Node, Key>
Call Signature
reatomLinkedList<
Params,Node,Key>(initState,name?):LinkedListAtom<Params,Node,Key>
Defined in: primitives/reatomLinkedList.ts:280
Type Parameters
Params
Params extends any[]
Node
Node extends Rec
Key
Key extends string | number | symbol = never
Parameters
initState
create?
(…params) => Node
initState
Node[]
key?
Key
name?
string
Returns
LinkedListAtom<Params, Node, Key>
Call Signature
reatomLinkedList<
Params,Node,Key>(initSnapshot,name?):LinkedListAtom<Params,Node,Key>
Defined in: primitives/reatomLinkedList.ts:293
Type Parameters
Params
Params extends any[]
Node
Node extends Rec
Key
Key extends string | number | symbol = never
Parameters
initSnapshot
create
(…params) => Node
initSnapshot?
Params[]
key?
Key
name?
string
Returns
LinkedListAtom<Params, Node, Key>
reatomMap()
reatomMap<
Key,Value>(initState,name):MapAtom<Key,Value>
Defined in: primitives/reatomMap.ts:41
Type Parameters
Key
Key
Value
Value
Parameters
initState
StateInit<Key, Value> = ...
name
string = ...
Returns
MapAtom<Key, Value>
reatomNumber()
reatomNumber(
initState,name):NumberAtom
Defined in: primitives/reatomNumber.ts:12
Parameters
initState
number = 0
name
string = ...
Returns
reatomRecord()
reatomRecord<
T>(initState,name):RecordAtom<T>
Defined in: primitives/reatomRecord.ts:12
Type Parameters
T
T extends Rec
Parameters
initState
Exclude<T, Fn>
name
string = ...
Returns
RecordAtom<T>
reatomSet()
reatomSet<
T>(initState,name):SetAtom<T>
Defined in: primitives/reatomSet.ts:17
Type Parameters
T
T
Parameters
initState
StateInit<T> = ...
name
string = ...
Returns
SetAtom<T>