Skip to main content

Type alias: EntitySet<T>

EntitySet<T>: {"add": Promise ↗️<void>;"remove": void; }

Strongly-typed entity unit of work add/remove functions.

Type parameters

Type parameter
T extends object

Type declaration

add()

Adds one or more entities to the current unit of work. The entities will be tracked in the added EntityState and will be inserted into the database when the unit of work is committed.

Parameters

ParameterTypeDescription
...entitiesreadonly T extends FromClass<T> ? Unbrand<T<T>> : Partial ↗️<T>[]The entities to be added to the unit of work.

Returns

Promise ↗️<void>

A promise that resolves when the entities have been successfully added to the unit of work.

remove()

Removes one or more entities from the current unit of work. The entities will be tracked in the removed EntityState and will be deleted from the database when the unit of work is committed.

Parameters

ParameterTypeDescription
...entitiesreadonly Unbrand<T>[]The entities to be removed from the unit of work.

Returns

void

Source

packages/verse-core/src/verse.ts:199