Delete all of the items in the list and remove the component from the entity.
Get the list of entity IDs in the list.
Load the full list of entities as an array.
Checks whether the given wrapper type matches the this entity.
Move an entity in the list from itemIdx
to newIdx
.
Get the raw LoroMovableList
.
Remove an entity from the list.
Register a callback that will be run when the entity is committed.
A function that may be called to unregister the callback.
Static
matchesChecks 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.
The string entity ID.
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.
Create a new entity of the given type.
This can be used to create a new Entity
for any type that implements
EntityWrapper
.
const roomy = await Roomy.init(peer, catalogId);
const space = roomy.create(Space);
Note: This method is inherited from
EntityWrapper
on all entity types, and it doesn't matter which type you callcreate()
on, they are all equivalent.
Open an existing Entity
using it's ID.
You provide an EntityWrapper
type like Space
or Message
that will be wrapped around the entity.
You will not usually need to create an EntityList yourself unless you are
implementing your own subclass of EntityWrapper
.
The Leaf peer.
The entity containing the list of other entities.
The underlying leaf component containing the list of other entities.
The EntityWrapper
type to wrap the entities in the list with.
The underlying Leaf Entity
.
The leaf peer instance.
Cast from one EntityWrapper
type to another.
Returns undefined
if EntityWrapper#matches
returns false
for the given
constructor type.
You will not usually need to cast entity types to other ones, but it can be useful in some
situations, where you would like to use another EntityWrapper
types's accessors.
An accessor for a list of other entities.
This access will allow you to read and modify the entities in the list.