UNPKG

@inworld/web-core

Version:
19 lines (18 loc) 715 B
import { EntityItem } from '../entities/entities/entity_item.js'; export class EntityService { constructor(connection) { this.connection = connection; } async createOrUpdateItems(props) { return this.connection.send(() => this.connection.getEventFactory().createOrUpdateItems({ items: props.items.map((item) => new EntityItem(item)), addToEntities: props.addToEntities, })); } async removeItems(ids) { return this.connection.send(() => this.connection.getEventFactory().removeItems(ids)); } async itemsInEntities(props) { return this.connection.send(() => this.connection.getEventFactory().itemsInEntities(props)); } }