StoreSchemaOptions

See source code
Table of contents

Configuration options for creating a StoreSchema.

These options control migration behavior, validation error handling, and integrity checking for the store schema.

interface StoreSchemaOptions<R extends UnknownRecord, P> {}

Example

const options: StoreSchemaOptions<MyRecord, MyProps> = {
  migrations: [bookMigrations, authorMigrations],
  onValidationFailure: (failure) => {
    // Log the error and return a corrected record
    console.error('Validation failed:', failure.error)
    return sanitizeRecord(failure.record)
  },
  createIntegrityChecker: (store) => {
    // Set up integrity checking logic
    return setupIntegrityChecks(store)
  },
}

Properties

migrations

optional
migrations?: MigrationSequence[]

Methods

onValidationFailure

optional

Parameters

NameDescription

data

Returns

R

Prev
StoreListenerFilters
Next
StoreSnapshot