function electricCollectionOptions<TExplicit, TSchema, TFallback>(config): object
function electricCollectionOptions<TExplicit, TSchema, TFallback>(config): object
Defined in: packages/electric-db-collection/src/electric.ts:285
Creates Electric collection options for use with a standard Collection
• TExplicit extends Row<unknown> = Row<unknown>
The explicit type of items in the collection (highest priority)
• TSchema extends StandardSchemaV1<unknown, unknown> = never
The schema type for validation and type inference (second priority)
• TFallback extends Row<unknown> = Row<unknown>
The fallback type if no explicit or schema type is provided
ElectricCollectionConfig<TExplicit, TSchema, TFallback>
Configuration options for the Electric collection
object
Collection options with utilities
getKey: (item) => string | number;
getKey: (item) => string | number;
ResolveType
string | number
optional id: string;
optional id: string;
All standard Collection configuration properties
onDelete:
| undefined
| (params) => Promise<{
txid: number | number[];
}> = wrappedOnDelete;
onDelete:
| undefined
| (params) => Promise<{
txid: number | number[];
}> = wrappedOnDelete;
onInsert:
| undefined
| (params) => Promise<{
txid: number | number[];
}> = wrappedOnInsert;
onInsert:
| undefined
| (params) => Promise<{
txid: number | number[];
}> = wrappedOnInsert;
onUpdate:
| undefined
| (params) => Promise<{
txid: number | number[];
}> = wrappedOnUpdate;
onUpdate:
| undefined
| (params) => Promise<{
txid: number | number[];
}> = wrappedOnUpdate;
optional schema: TSchema;
optional schema: TSchema;
sync: SyncConfig<ResolveType<TExplicit, TSchema, TFallback>, string | number>;
sync: SyncConfig<ResolveType<TExplicit, TSchema, TFallback>, string | number>;
utils: object;
utils: object;
awaitTxId: AwaitTxIdFn;
awaitTxId: AwaitTxIdFn;
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.