class DatasyncManager
Handles a set of subscriptions to data node and authentication events.
This class is intended to work with UI views in the way that it can cancel all handled subscriptions as soon as the associated view is disposed (see the unsubscribeFromAll method. Instances must be built using the DatasyncService.createManager method.
val service: DatasyncService
The DatasyncService instance associated with this DatasyncManager instance. |
operator fun div(path: String): DatasyncNode
Shortcut for the node method. |
|
fun node(path: String): DatasyncNode
Gets a DatasyncNode at a given path. |
|
fun resume(): Unit |
|
fun subscribeToAuthenticationChange(callback: (AuthenticationEvent) -> Unit): AuthenticationSubscription
Subscribes to changes on the authentication state of the DatasyncService associated with this DatasyncManager instance, and calls asynchronously the given callback each time this state changes. |
|
fun subscribeToStateChange(callback: (DatasyncState) -> Unit): Subscription
Subscribes to the DatasyncState of the DatasyncService associated with this DatasyncManager instance, and calls asynchronously the given callback each time this state changes. |
|
fun unsubscribeFromAll(): Unit
Cancels all the subscriptions managed by this DatasyncManager instance. These includes the ones created using the Subscriber.subscribe, subscribeToStateChange and subscribeToAuthenticationChange methods. |
|
fun unsubscribeFromAuthenticationChange(): Unit
Cancels all subscriptions to authentication changes managed by this DatasyncManager instance. |
|
fun unsubscribeFromNodeEvents(): Unit
Cancels all subscriptions to node events managed by this DatasyncManager instance. |