Interface Accessor<T>

type definition for a signal accessor (value getter) function.
notice that it contains a custom id property assigned to it, so it is not just any anonymous function. to manually replicate it, you will also need to assign an id property to the replica anonymous function.
this type of accessor is what is returned by a signal create function, as opposed to pure accessor function.

why would the id be needed?
often times, a dynamic-dependency signal (such as one that is an array of other accessors) needs to know the ids of its dependencies so that it can remove them later on, when they are no longer a dependency.

interface Accessor<T> {
    id: number;
    (observer_id?): T;
}

Type Parameters

  • T

Hierarchy (view full)

Properties

Properties

id: number

the id of the signal, from which this accessor originates from.
this property is statically inherited from Signal.id, when the accessor function is created by a signal create function.

Generated using TypeDoc