Notifier class abstract

Implementers

Constructors

Notifier()

Properties

attachedDbIndex AttachedDbIndex
Technically, we keep track of the attached dbs in two mappings -- one is alias: name, the other name: alias.
no setter
dbName DbName
The name of the primary database that components communicating via this notifier have open and are using.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

actuallyChanged(DbName dbName, List<Change> changes, ChangeOrigin origin) → void
When Satellite detects actual data changes in the oplog for a given database, it replicates it and calls actuallyChanged with the list of changes.
alias(ChangeNotification notification) List<QualifiedTablename>
And we provide a helper method to alias changes in the form {attachedDbName, tablenames} to aliasedTablenames.
attach(DbName dbName, String dbAlias) → void
Some drivers can attach other open databases and reference them by alias (i.e.: first you attach('foo.db') then you can write SQL queries like select * from foo.bars. We keep track of attached databases and their aliases, so we can map the table namespaces in SQL queries to their real database names and thus emit and handle notifications to and from them.
authStateChanged(AuthState authState) → void
Calling authStateChanged notifies the Satellite process that the user's authentication credentials have changed.
connectivityStateChanged(String dbName, ConnectivityState state) → void
Notification for network connectivity state changes. A connectivity change is automatically triggered in consequence of internal client events. 'connected': connection to Electric established 'disconnected': Electric is unreachable, or network is unavailable. A reason for the disconnection can be provided.
detach(String dbAlias) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
potentiallyChanged() → void
The data change notification workflow starts by the electric database clients (or the user manually) calling potentiallyChanged whenever a write or transaction has been issued that may have changed the contents of either the primary or any of the attached databases.
shapeSubscriptionSyncStatusChanged(String dbName, String key, SyncStatus status) → void
Notification for shape subscription sync status changes. Every notification will include a key that uniquely identifies the shape for which the sync status changed, as well as the new sync status.
subscribeToAuthStateChanges(AuthStateCallback callback) → UnsubscribeFunction
subscribeToConnectivityStateChanges(ConnectivityStateChangeCallback callback) → UnsubscribeFunction
subscribeToDataChanges(ChangeCallback callback) → UnsubscribeFunction
Reactive hooks then subscribe to "data has actually changed" notifications, using the info to trigger re-queries, if the changes affect databases and tables that their queries depend on. This then trigger re-rendering iff the query results are actually affected by the data changes.
subscribeToPotentialDataChanges(PotentialChangeCallback callback) → UnsubscribeFunction
Satellite processes subscribe to these "data has potentially changed" notifications. When they get one, they check the _oplog table in the database for actual changes persisted by the triggers.
subscribeToShapeSubscriptionSyncStatusChanges(ShapeSubscriptionSyncStatusChangeCallback callback) → UnsubscribeFunction
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited