The delay between when a change is made to Replicache and when Replicache attempts to push that change.
Creates a persistent secondary index in Replicache which can be used with scan.
If the named index already exists with the same definition this returns success immediately. If the named index already exists, but with a different definition an error is returned.
Drops an index previously created with createIndex.
Get a single value from the database.
Determines if a single key is present in the database.
Query is used for read transactions. It is recommended to use transactions
to ensure you get a consistent view across multiple calls to get, has
and scan.
Registers a mutator, which is used to make changes to the data.
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 sync, a description of each mutation is sent to the server's batch
endpoint
where it is applied. Once the mutation has been applied successfully, as
indicated by the client
view's
lastMutationId field, the local version of the mutation is removed. See
the design
doc for
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.
Gets many values from the database. This returns a ScanResult which
implements AsyncIterable. It also has methods to iterate over the keys
and entries.
If options has an indexName, then this does a scan over an index with
that name. A scan over an index uses a tuple for the key consisting of
[secondary: string, primary: string].
Convenience form of scan() which returns all the entries as an array.
When this is set to true the internal Replicache wasm module will log
more things to the console (using console.debug). Setting this to false
reduces the amount of logging done by the wasm module.
If you want to see the verbose logging from Replicache in Devtools/Web
Inspector you also need to change the console log level to Verbose.
Subcribe to changes to the underlying data. Every time the underlying data
changes body is called and if the result of body changes compared to
last time onData is called. The function is also called once the first
time the subscription is added.
This returns a function that can be used to cancel the subscription.
If an error occurs in the body the onError function is called if
present. Otherwise, the error is thrown.
Synchronizes this cache with the server. New local mutations are sent to the server, and the latest server state is applied to the cache. Any local mutations not included in the new server state are replayed. See the Replicache design document for more information on sync: https://github.com/rocicorp/replicache/blob/master/design.md
Generated using TypeDoc
This gets called when we get an HTTP unauthorized from the client view or the batch endpoint. Set this to a function that will ask your user to reauthenticate.