DataStore
struct DataStore
-
Dispatched when DataStore begins syncing to the remote API via the API category
Declaration
Swift
static let syncStarted: String -
Dispatched when DataStore receives a sync response from the remote API via the API category. This event does not define the source of the event–it could be in response to either a subscription or a locally-sourced mutation. Regardless of source, incoming sync updates always have the possibility of updating local data, so listeners who are interested in model updates must be notified in any case of a sync received. The HubPayload will be a
MutationEventinstance containing the newly mutated data from the remote API.Declaration
Swift
static let syncReceived: String -
Dispatched when DataStore receives a sync response from the remote API via the API category. The Hub Payload will be a
MutationEventinstance that caused the conditional save failed.Declaration
Swift
static let conditionalSaveFailed: String -
Dispatched when:
- the DataStore starts
- each time a local mutation is enqueued into the outbox
- each time a local mutation is finished processing
HubPayload
OutboxStatusEventcontains a boolean valueisEmptyto notify if there are mutations in the outbox
Declaration
Swift
static let outboxStatus: String -
Dispatched when DataStore has finished establishing its subscriptions to all syncable models
Declaration
Swift
static let subscriptionsEstablished: String -
Dispatched when DataStore is about to start sync queries HubPayload
syncQueriesStartedEventcontains an array of each model’snameDeclaration
Swift
static let syncQueriesStarted: String -
Dispatched once for each model after the model instances have been synced from the cloud. HubPayload
modelSyncedEventcontains: name of model, sync type (full/delta), count of instances’ mutation typeDeclaration
Swift
static let modelSynced: String -
Dispatched when all models have been synced
Declaration
Swift
static let syncQueriesReady: String -
Dispatched when:
- local store has loaded outgoing mutations from local storage
- if online, all data has finished syncing with cloud When this event is emitted, DataStore is ready to sync changes between the local device and the cloud
Declaration
Swift
static let ready: String -
Dispatched when DataStore starts and everytime network status changes HubPayload
NetworkStatusEventcontains a boolean valueactiveto notify network statusDeclaration
Swift
static let networkStatus: String -
Dispatched when a local mutation is enqueued into the outgoing mutation queue
outboxHubPayloadoutboxMutationEventcontains the name and instance of the modelDeclaration
Swift
static let outboxMutationEnqueued: String -
Dispatched when a mutation from outgoing mutation queue
outboxis sent to backend and updated locally. HubPayloadoutboxMutationEventcontains the name and instance of the modelDeclaration
Swift
static let outboxMutationProcessed: String
View on GitHub