Interface RealtimeObject

Enables the Objects to be read, modified and subscribed to for a channel.

Hierarchy

  • RealtimeObject

Methods

Methods

  • Retrieves a PathObject for the object on a channel. Implicitly attaches to the channel if not already attached.

    A type parameter can be provided to describe the structure of the Objects on the channel.

    Example:

    import { LiveCounter } from 'ably/liveobjects';

    type MyObject = {
    myTypedCounter: LiveCounter;
    };

    const myTypedObject = await channel.object.get<MyObject>();

    Type Parameters

    • T extends Record<string, Value>

    Returns Promise<LiveMapPathObject<T>>

    A promise which, upon success, will be fulfilled with a PathObject. Upon failure, the promise will be rejected with an ErrorInfo object which explains the error.

  • Removes all registrations that match both the specified listener and the specified event.

    Parameters

    Returns void

  • Registers the provided listener for the specified event. If on() is called more than once with the same listener and event, the listener is added multiple times to its listener registry. Therefore, as an example, assuming the same listener is registered twice using on(), and an event is emitted once, the listener would be invoked twice.

    Parameters

    Returns StatusSubscription

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

Generated using TypeDoc