@roomy-chat/sdk
    Preparing search index...

    Class EntityList<T, L>

    An accessor for a list of other entities.

    This access will allow you to read and modify the entities in the list.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Accessors

    • get length(): number

      The number of items in the list.

      Returns number

    Methods

    • Delete all of the items in the list and remove the component from the entity.

      Returns void

    • Get the list of entity IDs in the list.

      Returns `leaf:${string}`[]

    • Add an entity to the specified index in the list.

      Parameters

      • index: number
      • item: T

      Returns void

    • Load the full list of entities as an array.

      Returns Promise<T[]>

    • Add an entity to the end of the list.

      Parameters

      • item: T

      Returns void

    • Remove an entity from the list.

      Parameters

      • itemIdx: number

      Returns void

    • Register a callback that will be run when the entity is committed.

      Parameters

      • listener: () => void

      Returns () => void

      A function that may be called to unregister the callback.

    • Checks whether the given entity matches this wrapper type.

      The default implementation is to return true for every entity, but some wrappers will override it to check for the existence of certain marker components.

      Parameters

      Returns boolean

    General

    • get id(): `leaf:${string}`

      The string entity ID.

      Returns `leaf:${string}`

    • Commit any changes made to the entity.

      Important: You must call commit after making changes in order for those changes to be immediately applied, reacted to, and synced to network and/or storage.

      Returns void

    Constructors

    Advanced

    entity: Entity

    The underlying Leaf Entity.

    peer: Peer

    The leaf peer instance.