Skip to content

Misc

Action(init): NodeRef<void>

Defines a new stateless, valueless node and returns a reference to it. Once a realm instance publishes or subscribes to the node, an instance of that node it will be registered in the realm.

ParameterTypeDefault valueDescription
initNodeInit<void>noopan optional function that will be called when the node is registered in a realm. Can be used to create subscriptions and define relationships to other nodes. Any referred nodes will be registered in the realm automatically.

NodeRef<void>

ts

An action is just a signal with void value. It can be used to trigger side effects.


AsyncQuery<I, O>(query, defaultParams): PipeRef<I, QueryResult<O>>

Type Parameter
I
O
ParameterType
query(params) => Promise<O>
defaultParamsI

PipeRef<I, QueryResult<O>>


Cell<T>(value, init, distinct): NodeRef<T>

Defines a new stateful node and returns a reference to it. Once a realm instance publishes or subscribes to the node, an instance of that node it will be registered in the realm.

Type Parameter
T
ParameterTypeDefault valueDescription
valueTundefinedthe initial value of the node. Stateful nodes always have a value.
init(r) => voidnoopan optional function that will be called when the node is registered in a realm. Can be used to create subscriptions and define relationships to other nodes. Any referred nodes will be registered in the realm automatically.
distinctDistinct<T>trueif true, the node will only emit values that are different from the previous value. Optionally, a custom distinct function can be provided if the node values are non-primitive.

NodeRef<T>

ts

Unlike the RxJS BehaviorSubject, a stateful node does not immediately invoke its subscriptions when subscribed to. It only emits values when you publish something in it, either directly or through its relationships. If you need to get the current value of a stateful node, use Realm.getValue.


const changeWith: Realm["changeWith"]


const combine: Realm["combine"]


Comparator<T> = (previous, current) => boolean

A function which determines if two values are equal. Implement custom comparators for distinct nodes that contain non-primitive values.

Type ParameterDescription
TThe type of values that the comparator compares.
ParameterTypeDescription
previousT | undefinedThe value that previously passed through the node. can be undefined if the node has not emitted a value yet.
currentTThe value currently passing.

boolean

true if values should be considered equal.


debounceTime<I>(delay): Operator<I, I>

Debounces the output of a node with the specified delay.

Type Parameter
I
ParameterType
delaynumber

Operator<I, I>


defaultComparator<T>(current, next): boolean

The default comparator for distinct nodes - a function to determine if two values are equal. Works for primitive values.

Type Parameter
T
ParameterType
currentT
nextT

boolean


delayWithMicrotask<I>(): Operator<I, I>

Delays the output of a node with queueMicrotask.

Type Parameter
I

Operator<I, I>


DerivedCell<T>(value, linkFn, distinct): NodeRef<T>

Defines a new stateful node, links it to an existing node transform and returns a reference to it. Once a realm instance publishes or subscribes to the node, an instance of that node it will be registered in the realm.

Type Parameter
T
ParameterTypeDefault valueDescription
valueTundefinedthe initial value of the node. Stateful nodes always have a value.
linkFn(r, cell) => NodeRef<T>undefinedan function that will be called when the node is registered in a realm. Should return a node reference to link to.
distinctDistinct<T>trueif true, the node will only emit values that are different from the previous value. Optionally, a custom distinct function can be provided if the node values are non-primitive.

NodeRef<T>

ts

Distinct<T> = boolean | Comparator<T>

A type for the distinct parameter to the Cell and Signal constructors.

Type ParameterDescription
TThe type of values that the node emits.

filter<I, O>(predicate): Operator<I, O>

Operator that filters the output of a node. If the predicate returns false, the emission is canceled.

Type ParameterDefault type
I-
OI
ParameterType
predicate(value) => boolean

Operator<I, O>


const getValue: Realm["getValue"]


handlePromise<I, OutSuccess, OnLoad, OutError>(onLoad, onSuccess, onError): Operator<I | Promise<I>, OutSuccess | OnLoad | OutError>

Handles a promise value through the specified callbacks.

Type Parameter
I
OutSuccess
OnLoad
OutError
ParameterType
onLoad() => OnLoad
onSuccess(value) => OutSuccess
onError(error) => OutError

Operator<I | Promise<I>, OutSuccess | OnLoad | OutError>


Inp<T> = NodeRef<T> | PipeRef<T>

Type ParameterDefault type
Tunknown

const link: Realm["link"]


map<I, O>(mapFunction): Operator<I, O>

Maps a the passed value with a projection function.

Type Parameter
I
O
ParameterType
mapFunction(value) => O

Operator<I, O>


mapTo<I, O>(value): Operator<I, O>

Operator that maps the output of a node to a fixed value.

Type Parameter
I
O
ParameterType
valueO

Operator<I, O>


NodeInit<T> = (r, node$) => void

A node initializer function.

Type Parameter
T
ParameterType
rRealm
node$NodeRef<T>

void


NodeRef<T> = symbol & object

A typed reference to a node.

T

Type ParameterDefault typeDescription
TunknownThe type of values that the node emits.

O<In, Out> = Operator<In, Out>

Shorter alias for Operator, to avoid extra long type signatures.

Type Parameter
In
Out

once<I>(): Operator<I, I>

Operator that captures the first emitted value of a node. Useful if you want to execute a side effect only once.

Type Parameter
I

Operator<I, I>


onNext<I, O>(bufNode): Operator<I, [I, O]>

description Buffers the stream of a node until the passed note emits.

Type Parameter
I
O
ParameterType
bufNodeNodeRef<O>

Operator<I, [I, O]>


Operator<I, O> = (source, realm) => NodeRef<O>

An operator that transforms a node into another node, used in the Realm.pipe method.

Type Parameter
I
O
ParameterType
sourceOut<I>
realmRealm

NodeRef<O>


Out<T> = NodeRef<T> | PipeRef<unknown, T>

Type ParameterDefault type
Tunknown

const pipe: Realm["pipe"]


Pipe<I, O>(value, init, distinct): PipeRef<I, O>

Type Parameter
I
O
ParameterTypeDefault value
valueOundefined
init(r, input$, output$) => voidundefined
distinctDistinct<I>true

PipeRef<I, O>


PipeInit<I, O> = (r, inputRef$, outputRef$) => void

Type Parameter
I
O
ParameterType
rRealm
inputRef$NodeRef<I>
outputRef$NodeRef<O>

void


PipeRef<I, O> = symbol & object

I

O

Type ParameterDefault type
Iunknown
Ounknown

ProjectionFunc<T> = (done) => (…args) => void

Type ParameterDefault type
T extends unknown[]unknown[]
ParameterType
done(…values) => void

(…args): void

ParameterType
argsT

void


const pub: Realm["pub"]


const pubIn: Realm["pubIn"]


The realm is the actual “engine” that orchestrates any cells and signals that it touches. The realm also stores the state and the dependencies of the nodes that are referred through it.

new Realm(initialValues): Realm

Creates a new realm.

ParameterTypeDescription
initialValuesRecord<symbol, unknown>the initial cell values that will populate the realm. Those values will not trigger a recomputation cycle, and will overwrite the initial values specified for each cell.

Realm

cellInstance<T>(value, distinct, node): NodeRef<T>

Creates or resolves an existing cell instance in the realm. Useful as a joint point when building your own operators.

Type Parameter
T
ParameterTypeDefault valueDescription
valueTundefinedthe initial value of the cell
distinctDistinct<T>truetrue by default. Pass false to mark the signal as a non-distinct one, meaning that publishing the same value multiple times will re-trigger a recomputation cycle.
nodesymbol...optional, a reference to a cell. If the cell has not been touched in the realm before, the realm will instantiate a reference to it. If it’s registered already, the function will return the reference.

NodeRef<T>

a reference to the cell.


changeWith<T, K>(cell, source, map): void

Convenient for mutation of cells that contian non-primitive values (e.g. arrays, or objects). Specifies that the cell value should be changed when source emits, with the result of the map callback parameter. the map parameter gets called with the current value of the cell and the value published through the source.

Type ParameterDescription
Tthe type of the cell value.
Kthe type of the value published through the source.
ParameterType
cellInp<T>
sourceOut<K>
map(cellValue, signalValue) => T

void

ts

combine<T1>(…nodes): Out<T1>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
ParameterType
nodes[Out<T1>]

Out<T1>

combine<T1, T2>(…nodes): Out<[T1, T2]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
ParameterType
nodes[Out<T1>, Out<T2>]

Out<[T1, T2]>

combine<T1, T2, T3>(…nodes): Out<[T1, T2, T3]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>]

Out<[T1, T2, T3]>

combine<T1, T2, T3, T4>(…nodes): Out<[T1, T2, T3, T4]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>]

Out<[T1, T2, T3, T4]>

combine<T1, T2, T3, T4, T5>(…nodes): Out<[T1, T2, T3, T4, T5]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>]

Out<[T1, T2, T3, T4, T5]>

combine<T1, T2, T3, T4, T5, T6>(…nodes): Out<[T1, T2, T3, T4, T5, T6]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>]

Out<[T1, T2, T3, T4, T5, T6]>

combine<T1, T2, T3, T4, T5, T6, T7>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>]

Out<[T1, T2, T3, T4, T5, T6, T7]>

combine<T1, T2, T3, T4, T5, T6, T7, T8>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8]>

combine<T1, T2, T3, T4, T5, T6, T7, T8, T9>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>

combine<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>

combine<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]>

combine<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>, Out<T12>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]>

combine<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>, Out<T12>, Out<T13>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]>

combine<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]>

combine<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]>

combine<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]>

combine<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
T17
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]>

combine<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
T17
T18
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]>

combine<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]>

Combines the values from multiple nodes into a single node that emits an array of the latest values of the nodes.

When one of the source nodes emits a value, the combined node emits an array of the latest values from each node.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
T17
T18
T19
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]>


combineCells<T1>(…nodes): Out<[T1]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
ParameterType
nodes[Out<T1>]

Out<[T1]>

combineCells<T1, T2>(…nodes): Out<[T1, T2]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
ParameterType
nodes[Out<T1>, Out<T2>]

Out<[T1, T2]>

combineCells<T1, T2, T3>(…nodes): Out<[T1, T2, T3]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>]

Out<[T1, T2, T3]>

combineCells<T1, T2, T3, T4>(…nodes): Out<[T1, T2, T3, T4]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>]

Out<[T1, T2, T3, T4]>

combineCells<T1, T2, T3, T4, T5>(…nodes): Out<[T1, T2, T3, T4, T5]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>]

Out<[T1, T2, T3, T4, T5]>

combineCells<T1, T2, T3, T4, T5, T6>(…nodes): Out<[T1, T2, T3, T4, T5, T6]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>]

Out<[T1, T2, T3, T4, T5, T6]>

combineCells<T1, T2, T3, T4, T5, T6, T7>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>]

Out<[T1, T2, T3, T4, T5, T6, T7]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8, T9>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>, Out<T12>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>, Out<T12>, Out<T13>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
T17
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
T17
T18
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
T17
T18
T19
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
T17
T18
T19
T20
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20]>

combineCells<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(…nodes): Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21]>

Combines the values from multiple nodes into a cell that’s an array of the latest values of the nodes.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
T17
T18
T19
T20
T21
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

Out<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21]>


connect<T>(__namedParameters): void

A low-level utility that connects multiple nodes to a sink node with a map function. Used as a foundation for the higher-level operators. The nodes can be active (sources) or passive (pulls).

Type ParameterDefault type
T extends unknown[]unknown[]
ParameterTypeDescription
__namedParameters{ map: ProjectionFunc<T>; pulls?: Out<unknown>[]; sink: Inp; sources: Out<unknown>[]; }-
__namedParameters.mapProjectionFunc<T>The projection function that will be called when any of the source nodes emits.
__namedParameters.pulls?Out<unknown>[]The nodes which values will be pulled. The values will be passed as arguments to the map function.
__namedParameters.sinkInpThe sink node that will receive the result of the map function.
__namedParameters.sourcesOut<unknown>[]The source nodes that emit values to the sink node. The values will be passed as arguments to the map function.

void


getValue<T>(node): T

Gets the current value of a node. The node must be stateful.

Type Parameter
T
ParameterTypeDescription
nodeOut<T>the node instance.

T

If possible, use withLatestFrom or combine, as getValue will not create a dependency to the passed node, which means that if you call it within a computational cycle, you may not get the correct value.

ts

getValues<T1>(nodes): [T1]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T1
ParameterType
nodes[Out<T1>]

[T1]

getValues<T1, T2>(nodes): [T1, T2]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T1
T2
ParameterType
nodes[Out<T1>, Out<T2>]

[T1, T2]

getValues<T1, T2, T3>(nodes): [T1, T2, T3]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T1
T2
T3
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>]

[T1, T2, T3]

getValues<T1, T2, T3, T4>(nodes): [T1, T2, T3, T4]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T1
T2
T3
T4
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>]

[T1, T2, T3, T4]

getValues<T1, T2, T3, T4, T5>(nodes): [T1, T2, T3, T4, T5]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T1
T2
T3
T4
T5
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>]

[T1, T2, T3, T4, T5]

getValues<T1, T2, T3, T4, T5, T6>(nodes): [T1, T2, T3, T4, T5, T6]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T1
T2
T3
T4
T5
T6
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>]

[T1, T2, T3, T4, T5, T6]

getValues<T1, T2, T3, T4, T5, T6, T7>(nodes): [T1, T2, T3, T4, T5, T6, T7]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>]

[T1, T2, T3, T4, T5, T6, T7]

getValues<T1, T2, T3, T4, T5, T6, T7, T8>(nodes): [T1, T2, T3, T4, T5, T6, T7, T8]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>]

[T1, T2, T3, T4, T5, T6, T7, T8]

getValues<T1, T2, T3, T4, T5, T6, T7, T8, T9>(nodes): [T1, T2, T3, T4, T5, T6, T7, T8, T9]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>]

[T1, T2, T3, T4, T5, T6, T7, T8, T9]

getValues<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(nodes): [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>]

[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]

getValues<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(nodes): [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]

getValues<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(nodes): [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>, Out<T12>]

[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]

getValues<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(nodes): [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>, Out<T12>, Out<T13>]

[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]

getValues<T>(nodes): unknown[]

Gets the current values of the specified nodes. Works just like getValue, but with an array of node references.

Type Parameter
T
ParameterType
nodesOut<T>[]

unknown[]


inContext<T>(fn): T

Type Parameter
T
ParameterType
fn() => T

T


link<T>(source, sink): void

Links the output of a node to the input of another node.

Type Parameter
T
ParameterType
sourceOut<T>
sinkInp<T>

void


pipe<T>(s): NodeRef<T>

Creates a new node that emits the values of the source node transformed through the specified operators.

Type Parameter
T
ParameterType
sOut<T>

NodeRef<T>

ts

register(node$): PipeRef<unknown, unknown> | NodeRef<any>

Explicitly includes the specified cell/signal/pipe reference in the realm. Most of the time you don’t need to do that, since any interaction with the node through a realm will register it. The only exception of that rule should be when the interaction is conditional, and the node definition includes an init function that needs to be eagerly evaluated.

ParameterType
node$NodeRef<unknown> | PipeRef<unknown, unknown>

PipeRef<unknown, unknown> | NodeRef<any>


resetSingletonSubs(): void

Clears all exclusive subscriptions.

void


signalInstance<T>(distinct, node): NodeRef<T>

Creates or resolves an existing signal instance in the realm. Useful as a joint point when building your own operators.

Type Parameter
T
ParameterTypeDefault valueDescription
distinctDistinct<T>truetrue by default. Pass false to mark the signal as a non-distinct one, meaning that publishing the same value multiple times will re-trigger a recomputation cycle.
nodesymbol...optional, a reference to a signal. If the signal has not been touched in the realm before, the realm will instantiate a reference to it. If it’s registered already, the function will return the reference.

NodeRef<T>

a reference to the signal.


singletonSub<T>(node, subscription): UnsubscribeHandle

Subscribes exclusively to values in the referred node. Calling this multiple times on a single node will remove the previous subscription created through singletonSub. Subscriptions created through sub are not affected.

Type Parameter
T
ParameterType
nodeOut<T>
subscriptionSubscription<T> | undefined

UnsubscribeHandle

a function that, when called, will cancel the subscription.

ts

sub<T>(node, subscription): UnsubscribeHandle

Subscribes to the values published in the referred node.

Type Parameter
T
ParameterTypeDescription
nodeOut<T>the cell/signal to subscribe to.
subscriptionSubscription<T>the callback to execute when the node receives a new value.

UnsubscribeHandle

a function that, when called, will cancel the subscription.

ts

subMultiple<T1>(nodes, subscription): UnsubscribeHandle

Subscribes to multiple nodes at once. If any of the nodes emits a value, the subscription will be called with an array of the latest values from each node. If the nodes change within a single execution cycle, the subscription will be called only once with the final node values.

Type Parameter
T1
ParameterType
nodes[Out<T1>]
subscriptionSubscription<[T1]>

UnsubscribeHandle

ts

subMultiple<T1, T2>(nodes, subscription): UnsubscribeHandle

Subscribes to multiple nodes at once. If any of the nodes emits a value, the subscription will be called with an array of the latest values from each node. If the nodes change within a single execution cycle, the subscription will be called only once with the final node values.

Type Parameter
T1
T2
ParameterType
nodes[Out<T1>, Out<T2>]
subscriptionSubscription<[T1, T2]>

UnsubscribeHandle

ts

subMultiple<T1, T2, T3>(nodes, subscription): UnsubscribeHandle

Subscribes to multiple nodes at once. If any of the nodes emits a value, the subscription will be called with an array of the latest values from each node. If the nodes change within a single execution cycle, the subscription will be called only once with the final node values.

Type Parameter
T1
T2
T3
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>]
subscriptionSubscription<[T1, T2, T3]>

UnsubscribeHandle

ts

subMultiple<T1, T2, T3, T4>(nodes, subscription): UnsubscribeHandle

Subscribes to multiple nodes at once. If any of the nodes emits a value, the subscription will be called with an array of the latest values from each node. If the nodes change within a single execution cycle, the subscription will be called only once with the final node values.

Type Parameter
T1
T2
T3
T4
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>]
subscriptionSubscription<[T1, T2, T3, T4]>

UnsubscribeHandle

ts

subMultiple<T1, T2, T3, T4, T5>(nodes, subscription): UnsubscribeHandle

Subscribes to multiple nodes at once. If any of the nodes emits a value, the subscription will be called with an array of the latest values from each node. If the nodes change within a single execution cycle, the subscription will be called only once with the final node values.

Type Parameter
T1
T2
T3
T4
T5
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>]
subscriptionSubscription<[T1, T2, T3, T4, T5]>

UnsubscribeHandle

ts

subMultiple<T1, T2, T3, T4, T5, T6>(nodes, subscription): UnsubscribeHandle

Subscribes to multiple nodes at once. If any of the nodes emits a value, the subscription will be called with an array of the latest values from each node. If the nodes change within a single execution cycle, the subscription will be called only once with the final node values.

Type Parameter
T1
T2
T3
T4
T5
T6
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>]
subscriptionSubscription<[T1, T2, T3, T4, T5, T6]>

UnsubscribeHandle

ts

subMultiple<T1, T2, T3, T4, T5, T6, T7>(nodes, subscription): UnsubscribeHandle

Subscribes to multiple nodes at once. If any of the nodes emits a value, the subscription will be called with an array of the latest values from each node. If the nodes change within a single execution cycle, the subscription will be called only once with the final node values.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>]
subscriptionSubscription<[T1, T2, T3, T4, T5, T6, T7]>

UnsubscribeHandle

ts

subMultiple<T1, T2, T3, T4, T5, T6, T7, T8>(nodes, subscription): UnsubscribeHandle

Subscribes to multiple nodes at once. If any of the nodes emits a value, the subscription will be called with an array of the latest values from each node. If the nodes change within a single execution cycle, the subscription will be called only once with the final node values.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>]
subscriptionSubscription<[T1, T2, T3, T4, T5, T6, T7, T8]>

UnsubscribeHandle

ts

subMultiple(nodes, subscription): UnsubscribeHandle

Subscribes to multiple nodes at once. If any of the nodes emits a value, the subscription will be called with an array of the latest values from each node. If the nodes change within a single execution cycle, the subscription will be called only once with the final node values.

ParameterType
nodesOut<unknown>[]
subscriptionSubscription<any>

UnsubscribeHandle

ts

transformer<In>(…o): (s) => Inp<In>

Works as a reverse pipe. Constructs a function, that, when passed a certain node (sink), will create a node that will work as a publisher through the specified pipes into the sink.

Type Parameter
In
ParameterType
o[]

(s): Inp<In>

ParameterType
sInp<In>

Inp<In>

ts

transformer<In, Out>(…o): (s) => Inp<In>

Works as a reverse pipe. Constructs a function, that, when passed a certain node (sink), will create a node that will work as a publisher through the specified pipes into the sink.

Type Parameter
In
Out
ParameterType
o[O<In, Out>]

(s): Inp<In>

ParameterType
sInp<Out>

Inp<In>

ts

transformer<In, Out, O1>(…o): (s) => Inp<In>

Works as a reverse pipe. Constructs a function, that, when passed a certain node (sink), will create a node that will work as a publisher through the specified pipes into the sink.

Type Parameter
In
Out
O1
ParameterType
o[O<In, O1>, O<O1, Out>]

(s): Inp<In>

ParameterType
sInp<Out>

Inp<In>

ts

transformer<In, Out, O1, O2>(…o): (s) => Inp<In>

Works as a reverse pipe. Constructs a function, that, when passed a certain node (sink), will create a node that will work as a publisher through the specified pipes into the sink.

Type Parameter
In
Out
O1
O2
ParameterType
o[O<In, O1>, O<O1, O2>, O<O2, Out>]

(s): Inp<In>

ParameterType
sInp<Out>

Inp<In>

ts

transformer<In, Out, O1, O2, O3>(…o): (s) => Inp<In>

Works as a reverse pipe. Constructs a function, that, when passed a certain node (sink), will create a node that will work as a publisher through the specified pipes into the sink.

Type Parameter
In
Out
O1
O2
O3
ParameterType
o[O<In, O1>, O<O1, O2>, O<O2, O3>, O<O3, Out>]

(s): Inp<In>

ParameterType
sInp<Out>

Inp<In>

ts

transformer<In, Out, O1, O2, O3, O4>(…o): (s) => Inp<In>

Works as a reverse pipe. Constructs a function, that, when passed a certain node (sink), will create a node that will work as a publisher through the specified pipes into the sink.

Type Parameter
In
Out
O1
O2
O3
O4
ParameterType
o[O<In, O1>, O<O1, O2>, O<O2, O3>, O<O3, O4>, O<O4, Out>]

(s): Inp<In>

ParameterType
sInp<Out>

Inp<In>

ts

transformer<In, Out, O1, O2, O3, O4, O5>(…o): (s) => Inp<In>

Works as a reverse pipe. Constructs a function, that, when passed a certain node (sink), will create a node that will work as a publisher through the specified pipes into the sink.

Type Parameter
In
Out
O1
O2
O3
O4
O5
ParameterType
o[O<In, O1>, O<O1, O2>, O<O2, O3>, O<O3, O4>, O<O4, O5>, O<O5, Out>]

(s): Inp<In>

ParameterType
sInp<Out>

Inp<In>

ts

transformer<In, Out>(…operators): (s) => Inp<In>

Works as a reverse pipe. Constructs a function, that, when passed a certain node (sink), will create a node that will work as a publisher through the specified pipes into the sink.

Type Parameter
In
Out
ParameterType
operatorsO<unknown, unknown>[]

(s): Inp<In>

ParameterType
sInp<Out>

Inp<In>

ts

const RealmContext: Context<Realm | null>


RealmProvider(__namedParameters): Element

ParameterTypeDescription
__namedParameters{ children: ReactNode; initWith?: Record<string, unknown>; updateWith?: Record<string, unknown>; }-
__namedParameters.childrenReactNodeThe children to render
__namedParameters.initWith?Record<string, unknown>The initial values to set in the realm
__namedParameters.updateWith?Record<string, unknown>The values to update in the realm on each render

Element


scan<I, O>(accumulator, seed): Operator<I, O>

Operator that runs with the latest and the current value of a node. Works like the RxJS scan operator.

Type Parameter
I
O
ParameterType
accumulator(current, value) => O
seedO

Operator<I, O>


Signal<T>(init, distinct): NodeRef<T>

Defines a new stateless node and returns a reference to it. Once a realm instance publishes or subscribes to the node, an instance of that node it will be registered in the realm.

Type Parameter
T
ParameterTypeDefault valueDescription
initNodeInit<T>noopan optional function that will be called when the node is registered in a realm. Can be used to create subscriptions and define relationships to other nodes. Any referred nodes will be registered in the realm automatically.
distinctDistinct<T>falsetrue by default. The node emits values that are different from the previous value. Optionally, a custom distinct function can be provided if the node values are non-primitive.

NodeRef<T>

ts

const sub: Realm["sub"]


Subscription<T> = (value) => unknown

A function that is called when a node emits a value.

Type ParameterDescription
TThe type of values that the node emits.
ParameterType
valueT

unknown


throttleTime<I>(delay): Operator<I, I>

Throttles the output of a node with the specified delay.

Type Parameter
I
ParameterType
delaynumber

Operator<I, I>


UnsubscribeHandle = () => void

The resulting type of a subscription to a node. Can be used to cancel the subscription.

void


useCell<O, I>(cell): [O, (value) => void]

Returns a tuple of the current value of the cell and a publisher function (similar to useState). The component will be re-rendered when the cell value changes.

Type ParameterDefault type
O-
IO
ParameterTypeDescription
cellNodeRef<O> | PipeRef<I, O>The cell to use.

[O, (value) => void]

A tuple of the current value of the cell and a publisher function.

If you need just a publisher, use usePublisher.


const useCellValue: <T>(cell) => T

Gets the current value of the cell. The component is re-rendered when the cell value changes.

Type ParameterDescription
Tthe type of the value that the cell caries.
ParameterTypeDescription
cellOut<T>The cell to use.

T

The current value of the cell.

If you need the values of multiple nodes from the realm and those nodes might change in the same computation, you can useCellValues to reduce re-renders.

tsx

useCellValues<T1>(…cells): [T1]

Retreives the values of the passed cells. The component is re-rendered each time any of the referred cells changes its value.

Type Parameter
T1
ParameterType
cells[Out<T1>]

[T1]

tsx

useCellValues<T1, T2>(…cells): [T1, T2]

Retreives the values of the passed cells. The component is re-rendered each time any of the referred cells changes its value.

Type Parameter
T1
T2
ParameterType
cells[Out<T1>, Out<T2>]

[T1, T2]

tsx

useCellValues<T1, T2, T3>(…cells): [T1, T2, T3]

Retreives the values of the passed cells. The component is re-rendered each time any of the referred cells changes its value.

Type Parameter
T1
T2
T3
ParameterType
cells[Out<T1>, Out<T2>, Out<T3>]

[T1, T2, T3]

tsx

useCellValues<T1, T2, T3, T4>(…cells): [T1, T2, T3, T4]

Retreives the values of the passed cells. The component is re-rendered each time any of the referred cells changes its value.

Type Parameter
T1
T2
T3
T4
ParameterType
cells[Out<T1>, Out<T2>, Out<T3>, Out<T4>]

[T1, T2, T3, T4]

tsx

useCellValues<T1, T2, T3, T4, T5>(…cells): [T1, T2, T3, T4, T5]

Retreives the values of the passed cells. The component is re-rendered each time any of the referred cells changes its value.

Type Parameter
T1
T2
T3
T4
T5
ParameterType
cells[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>]

[T1, T2, T3, T4, T5]

tsx

useCellValues<T1, T2, T3, T4, T5, T6>(…cells): [T1, T2, T3, T4, T5, T6]

Retreives the values of the passed cells. The component is re-rendered each time any of the referred cells changes its value.

Type Parameter
T1
T2
T3
T4
T5
T6
ParameterType
cells[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>]

[T1, T2, T3, T4, T5, T6]

tsx

useCellValues<T1, T2, T3, T4, T5, T6, T7>(…cells): [T1, T2, T3, T4, T5, T6, T7]

Retreives the values of the passed cells. The component is re-rendered each time any of the referred cells changes its value.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
ParameterType
cells[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>]

[T1, T2, T3, T4, T5, T6, T7]

tsx

useCellValues<T1, T2, T3, T4, T5, T6, T7, T8>(…cells): [T1, T2, T3, T4, T5, T6, T7, T8]

Retreives the values of the passed cells. The component is re-rendered each time any of the referred cells changes its value.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
ParameterType
cells[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>]

[T1, T2, T3, T4, T5, T6, T7, T8]

tsx

useCellValues<T1, T2, T3, T4, T5, T6, T7, T8, T9>(…cells): [T1, T2, T3, T4, T5, T6, T7, T8, T9]

Retreives the values of the passed cells. The component is re-rendered each time any of the referred cells changes its value.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
ParameterType
cells[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>]

[T1, T2, T3, T4, T5, T6, T7, T8, T9]

tsx

useCellValues<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(…cells): [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]

Retreives the values of the passed cells. The component is re-rendered each time any of the referred cells changes its value.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
ParameterType
cells[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>]

[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]

tsx

useCellValues<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(…cells): [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]

Retreives the values of the passed cells. The component is re-rendered each time any of the referred cells changes its value.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
ParameterType
cells[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>]

[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]

tsx

useCellValues<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(…cells): [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]

Retreives the values of the passed cells. The component is re-rendered each time any of the referred cells changes its value.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
ParameterType
cells[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>, Out<T12>]

[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]

tsx

useCellValues<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(…cells): [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]

Retreives the values of the passed cells. The component is re-rendered each time any of the referred cells changes its value.

Type Parameter
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
ParameterType
cells[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>, Out<T9>, Out<T10>, Out<T11>, Out<T12>, Out<T13>]

[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]

tsx

usePublisher<T>(node): (value) => void

Returns a function that publishes its passed argument into the specified node.

Type Parameter
T
ParameterType
nodeInp<T>

(value): void

ParameterType
valueT

void

tsx

useRealm(): Realm

Returns a direct reference to the current realm. Use with caution.

If possible, design your logic in a reactive manner, and use useCellValue and usePublisher to access the output of the realm.

Realm


withLatestFrom<I, T1>(…nodes): (source) => NodeRef<[I, T1]>

Pulls the latest values from the passed nodes. Note: The operator does not emit when the nodes emit. If you want to get that, use the combine function.

Type Parameter
I
T1
ParameterType
nodes[Out<T1>]

(source): NodeRef<[I, T1]>

ParameterType
sourceOut<I>

NodeRef<[I, T1]>

withLatestFrom<I, T1, T2>(…nodes): (source) => NodeRef<[I, T1, T2]>

Pulls the latest values from the passed nodes. Note: The operator does not emit when the nodes emit. If you want to get that, use the combine function.

Type Parameter
I
T1
T2
ParameterType
nodes[Out<T1>, Out<T2>]

(source): NodeRef<[I, T1, T2]>

ParameterType
sourceOut<I>

NodeRef<[I, T1, T2]>

withLatestFrom<I, T1, T2, T3>(…nodes): (source) => NodeRef<[I, T1, T2, T3]>

Pulls the latest values from the passed nodes. Note: The operator does not emit when the nodes emit. If you want to get that, use the combine function.

Type Parameter
I
T1
T2
T3
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>]

(source): NodeRef<[I, T1, T2, T3]>

ParameterType
sourceOut<I>

NodeRef<[I, T1, T2, T3]>

withLatestFrom<I, T1, T2, T3, T4>(…nodes): (source) => NodeRef<[I, T1, T2, T3, T4]>

Pulls the latest values from the passed nodes. Note: The operator does not emit when the nodes emit. If you want to get that, use the combine function.

Type Parameter
I
T1
T2
T3
T4
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>]

(source): NodeRef<[I, T1, T2, T3, T4]>

ParameterType
sourceOut<I>

NodeRef<[I, T1, T2, T3, T4]>

withLatestFrom<I, T1, T2, T3, T4, T5>(…nodes): (source) => NodeRef<[I, T1, T2, T3, T4, T5]>

Pulls the latest values from the passed nodes. Note: The operator does not emit when the nodes emit. If you want to get that, use the combine function.

Type Parameter
I
T1
T2
T3
T4
T5
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>]

(source): NodeRef<[I, T1, T2, T3, T4, T5]>

ParameterType
sourceOut<I>

NodeRef<[I, T1, T2, T3, T4, T5]>

withLatestFrom<I, T1, T2, T3, T4, T5, T6>(…nodes): (source) => NodeRef<[I, T1, T2, T3, T4, T5, T6]>

Pulls the latest values from the passed nodes. Note: The operator does not emit when the nodes emit. If you want to get that, use the combine function.

Type Parameter
I
T1
T2
T3
T4
T5
T6
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>]

(source): NodeRef<[I, T1, T2, T3, T4, T5, T6]>

ParameterType
sourceOut<I>

NodeRef<[I, T1, T2, T3, T4, T5, T6]>

withLatestFrom<I, T1, T2, T3, T4, T5, T6, T7>(…nodes): (source) => NodeRef<[I, T1, T2, T3, T4, T5, T6, T7]>

Pulls the latest values from the passed nodes. Note: The operator does not emit when the nodes emit. If you want to get that, use the combine function.

Type Parameter
I
T1
T2
T3
T4
T5
T6
T7
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>]

(source): NodeRef<[I, T1, T2, T3, T4, T5, T6, T7]>

ParameterType
sourceOut<I>

NodeRef<[I, T1, T2, T3, T4, T5, T6, T7]>

withLatestFrom<I, T1, T2, T3, T4, T5, T6, T7, T8>(…nodes): (source) => NodeRef<[I, T1, T2, T3, T4, T5, T6, T7, T8]>

Pulls the latest values from the passed nodes. Note: The operator does not emit when the nodes emit. If you want to get that, use the combine function.

Type Parameter
I
T1
T2
T3
T4
T5
T6
T7
T8
ParameterType
nodes[Out<T1>, Out<T2>, Out<T3>, Out<T4>, Out<T5>, Out<T6>, Out<T7>, Out<T8>]

(source): NodeRef<[I, T1, T2, T3, T4, T5, T6, T7, T8]>

ParameterType
sourceOut<I>

NodeRef<[I, T1, T2, T3, T4, T5, T6, T7, T8]>