DatasyncManager

class DatasyncManager : Closeable

Handles a set of subscriptions to data nodes 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 clearSubscriptions method). Instances must be built using the DatasyncService.createManager method.

Functions

Link copied to clipboard
fun clearSubscriptions()

Clear the subscriptions handled by this DatasyncManager instance

Link copied to clipboard
open override fun close()

Disposes the resources handled by this DatasyncManager instance, that is all its subscriptions and all allocated JS resources (callbacks)

Link copied to clipboard
fun dispose()

Disposes the resources handled by this DatasyncManager instance, that is all its subscriptions and all allocated JS resources (callbacks).

Link copied to clipboard
operator fun div(path: String): DatasyncNode

Shortcut for the node method.

Link copied to clipboard
fun node(path: String): DatasyncNode

Gets a DatasyncNode at a given path.

Link copied to clipboard
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.

Properties

Link copied to clipboard
val policy: CancelationPolicy

The CancelationPolicy associated with this DatasyncManager instance, which controls the management of cached data when subscriptions are canceled.

Link copied to clipboard
val rootNode: DatasyncNode

Gets the root DatasyncNode.

Link copied to clipboard
val service: DatasyncService

The DatasyncService instance associated with this DatasyncManager instance.