Interface PrimitivePathObject<T>

A PathObject representing a primitive value at a specific path.

Type Parameters

Hierarchy

Methods

  • Get a JavaScript object representation of the primitive value at this path. This is an alias for calling value().

    If the path does not resolve to any specific entry, returns undefined.

    Returns undefined | CompactedValue<T>

  • Get a JSON-serializable representation of the primitive value at this path. Binary values are converted to base64-encoded strings.

    If the path does not resolve to any specific entry, returns undefined.

    Returns undefined | CompactedJsonValue<T>

  • Get the fully-qualified path string for this PathObject.

    Path segments with dots in them are escaped with a backslash. For example, a path with segments ['a', 'b.c', 'd'] will be represented as a.b\.c.d.

    Returns string

  • Registers a listener that is called each time the object or a primitive value at this path is updated.

    The provided listener receives a PathObject representing the path at which there was an object change, and, if applicable, an ObjectMessage that carried the operation that led to the change.

    By default, subscriptions observe nested changes, but you can configure the observation depth using the options parameter.

    A PathObject subscription observes whichever value currently exists at this path. The subscription remains active even if the path temporarily does not resolve to any value (for example, if an entry is removed from a map). If the object instance at this path changes, the subscription automatically switches to observe the new instance and stops observing the old one.

    Parameters

    Returns Subscription

    A Subscription object that allows the provided listener to be deregistered from future updates.

  • Get the current value of the primitive currently at this path. If the path does not resolve to any specific entry, returns undefined.

    Returns undefined | T

Generated using TypeDoc