an 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.
true 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.
const foo$ = Signal<string>(true, (r) => {
r.sub(foo$, console.log)
})
const r = new Realm()
r.pub(foo$, 'bar') // the subscription will log 'bar'
Generated using TypeDoc
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.