DataStoreHubEvent constructor

DataStoreHubEvent(
  1. String eventName, {
  2. required DataStoreHubEventType type,
  3. DataStoreHubEventPayload? payload,
})

DataStore periodically publishes state notifications onto Amplify's Hub. You can subscribe to the Hub to gain insight into the internal state of the DataStore.

The following example shows how to listen to DataStore Hub events:

Amplify.Hub.listen(HubChannel.DataStore, (msg) {
 if (msg.type == DataStoreHubType.ready) {
   print('DataStore is ready!');
 }
 print(msg);
});

Implementation

DataStoreHubEvent(
  super.eventName, {
  required this.type,
  super.payload,
});