KeyedPhysicalReplica
Keyed replica replicates multiple chunks of data - different chunks for different keys. Internally it uses PhysicalReplica for individual data chunks.
The difference between KeyedReplica and KeyedPhysicalReplica is that the latter has a richer API. KeyedReplica has minimalistic read-only API, whereas KeyedPhysicalReplica allows to cancel requests, modify data, execute optimistic updates.
Functions
Clears error stored in ReplicaState for a given key.
Commits optimistic update for a given key. Child replica forgets previous data.
Returns current ReplicaState for a given key.
Makes data stale if it is exists for a given key. It also could call a refresh depending on InvalidationMode.
Starts to observe a keyed replica. Returned ReplicaObserver gives access to replica state and error events.
Executes an action on each child PhysicalReplica.
Executes an action on a PhysicalReplica with a given key. If the replica doesn't exist the action is not executed.
Executes an action on a PhysicalReplica with a given key. If the replica doesn't exist it is created.
Loads fresh data from a network for a given key if it is stale.
Rollbacks optimistic update for a given key. Observed data will be replaced to the previous one.
Properties
Notifies that some KeyedReplicaEvent has occurred.
Settings, see: KeyedReplicaSettings
Provides KeyedReplicaState as an observable value.
Extensions
Cancels network requests in child replicas with the matching tags.
Cancels network requests and clears data in child replicas with the matching tags.
Returns current KeyedReplicaState.
Makes all child replicas stale.
Makes child replicas with the matching tags stale.