The options passed to Replicache.
Optional logLevel: LogLevel
Determines how much logging to do. When this is set to
Replicache will also log
'error' messages. When set to
'info' we log
'error' but not
'debug'. When set to
'error' we only log
Defined in: replicache.ts:157
Optional mutators: MD
An object used as a map to define the mutators. These gets registered at startup of Replicache.
Mutators are used to make changes to the data.
This will create the function to later use:
Mutators run once when they are initially invoked, but they might also be replayed multiple times during sync. As such mutators should not modify application state directly. Also, it is important that the set of registered mutator names only grows over time. If Replicache syncs and needed mutator is not registered, it will substitute a no-op mutator, but this might be a poor user experience.
During push, a description of each mutation is sent to the server's push
where it is applied. Once the mutation has been applied successfully, as
indicated by the client
lastMutationId field, the local version of the mutation is removed. See
additional details on the sync protocol.
Mutators are atomic: all their changes are applied together, or none are. Throwing an exception aborts the transaction. Otherwise, it is committed. As with query and subscribe all reads will see a consistent view of the cache while they run.
Defined in: replicache.ts:225
Optional name: string
The name of the Replicache database. This defaults to
You can use multiple Replicache instances as long as the names are unique.
Using different names for different users allows you to switch users even when you are offline.
Defined in: replicache.ts:100
Optional pullAuth: string
Defined in: replicache.ts:82
Optional pullInterval: null | number
The duration between each pull. Set this to
null to prevent pulling
in the background.
Defined in: replicache.ts:113
Optional pullURL: string
This is the URL to the server endpoint dealing with pull. See Server Setup Downstream Sync for more details.
Defined in: replicache.ts:90
Optional pushAuth: string
Defined in: replicache.ts:67
Optional pushDelay: number
The delay between when a change is made to Replicache and when Replicache attempts to push that change.
Defined in: replicache.ts:119
Optional pushURL: string
This is the URL to the server endpoint dealing with the push updates. See Server Setup Upstream Sync for more details.
Defined in: replicache.ts:74
Optional schemaVersion: string
The schema version of the data understood by this application. This enables versioning of mutators (in the push direction) and the client view (in the pull direction).
Defined in: replicache.ts:107
Optional useMemstore: boolean
Allows using an in memory store instead of IndexedDB. This is useful for
testing for example. Notice that when this is
true no data is persisted
in Replicache and all the data that has not yet been synced when Replicache
is closed or the page is unloaded is lost.
Defined in: replicache.ts:149
Optional wasmModule: InitInput
By default we will load the Replicache wasm module relative to the Replicache js files but under some circumstances (like bundling with old versions of Webpack) it is useful to manually configure where the wasm module is located on the web server.
If you provide your own path to the wasm module it probably makes sense to use a relative URL relative to your current file.
You might also want to consider using an absolute URL so that we can find the wasm module no matter where your js file is loaded from:
Defined in: replicache.ts:141