makeSchema
constmakeSchema: <TSchema>(schema) =>ForRecord<TSchema["_EventDefMapType"]>
Defined in: packages/@livestore/common/dist/schema/LiveStoreEvent/client.d.ts:285
Creates an Effect Schema union for all event types in a schema (with composite sequence numbers).
Type Parameters
Section titled “Type Parameters”TSchema
Section titled “TSchema”TSchema extends LiveStoreSchema
Parameters
Section titled “Parameters”schema
Section titled “schema”TSchema
Returns
Section titled “Returns”ForRecord<TSchema["_EventDefMapType"]>
Example
Section titled “Example”const eventSchema = LiveStoreEvent.Client.makeSchema(schema)const event = Schema.decodeUnknownSync(eventSchema)(rawEvent)