Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

editList

editList<Item, Owner>(writer, entity, field): ListEditor<Item>

entity’s list field, to edit: each change is checked against the list’s most and recorded, so the send carries one push as one operation. The first write copies the list, so a reader that kept it sees it as it was. The writer is as editTrait’s.

Type Parameter
Item
Owner extends UnstreamedTrait
Parameter Type
writer SetupWriter | EntityAuthority | SystemStep
entity Entity
field ListField<Item, Owner>

ListEditor<Item>

editList(step, bag, BagTrait.fields.slots).push({ item: "torch", count: 3 });

editList<Item, Owner>(writer, entity, field): ListEditor<Item>

entity’s list field, to edit: each change is checked against the list’s most and recorded, so the send carries one push as one operation. The first write copies the list, so a reader that kept it sees it as it was. The writer is as editTrait’s.

Type Parameter
Item
Owner extends LocalTrait
Parameter Type
writer ViewWriter
entity Entity
field ListField<Item, Owner>

ListEditor<Item>

editList(step, bag, BagTrait.fields.slots).push({ item: "torch", count: 3 });

editList<Item, Owner>(writer, entity, field): ListEditor<Item>

entity’s list field, to edit: each change is checked against the list’s most and recorded, so the send carries one push as one operation. The first write copies the list, so a reader that kept it sees it as it was. The writer is as editTrait’s.

Type Parameter
Item
Owner extends Trait
Parameter Type
writer SetupWriter | EntityAuthority
entity Entity
field ListField<Item, Owner>

ListEditor<Item>

editList(step, bag, BagTrait.fields.slots).push({ item: "torch", count: 3 });