DefineEventOptions
DefineEventOptions<
TTo,TDerived> =object
Defined in: packages/@livestore/common/dist/schema/EventDef/define.d.ts:34
Options for defining an event.
Type Parameters
Section titled “Type Parameters”TTo
TDerived
Section titled “TDerived”TDerived extends boolean = false
Properties
Section titled “Properties”clientOnly?
Section titled “clientOnly?”
optionalclientOnly: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.
Default
Section titled “Default”falsederived?
Section titled “derived?”
optionalderived: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.
Default
Section titled “Default”falsefacts()?
Section titled “facts()?”
optionalfacts: (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.
Parameters
Section titled “Parameters”TTo
currentFacts
Section titled “currentFacts”Returns
Section titled “Returns”modify?
Section titled “modify?”
optionalmodify:object
modify.set?
Section titled “modify.set?”
optionalset:Iterable<EventDefFactInput>
Facts to set (create or update).
modify.unset?
Section titled “modify.unset?”
optionalunset:Iterable<EventDefFactInput>
Facts to unset (remove).
require?
Section titled “require?”
optionalrequire:Iterable<EventDefFactInput>
Facts that must exist for this event to be valid. Used for history constraints and compaction rules.