Skip to content

DefineEventOptions

DefineEventOptions<TTo, TDerived> = object

Defined in: packages/@livestore/common/dist/schema/EventDef/define.d.ts:34

Options for defining an event.

TTo

TDerived extends boolean = false

optional clientOnly: boolean

Defined in: packages/@livestore/common/dist/schema/EventDef/define.d.ts:57

When true, the event is only synced within the same client’s sessions but never sent to the sync backend. Useful for UI state.

false

optional derived: TDerived

Defined in: packages/@livestore/common/dist/schema/EventDef/define.d.ts:62

When true, marks this as a derived event that cannot have materializers.

false

optional facts: (args, currentFacts) => object

Defined in: packages/@livestore/common/dist/schema/EventDef/define.d.ts:39

Callback defining fact constraints for this event. This feature is not fully implemented yet.

TTo

EventDefFacts

optional modify: object

optional set: Iterable<EventDefFactInput>

Facts to set (create or update).

optional unset: Iterable<EventDefFactInput>

Facts to unset (remove).

optional require: Iterable<EventDefFactInput>

Facts that must exist for this event to be valid. Used for history constraints and compaction rules.