subscribe
suspend fun subscribe(path: Path = AbsolutePath.MATCH_ALL, onSubscription: OnSubscription? = null, eventHandler: EventHandler): Unsubscribe(source)
suspend fun subscribe(path: String, onSubscription: OnSubscription? = null, eventHandler: EventHandler): Unsubscribe(source)
Subscribes to all events with paths matching path by running eventHandler for each event. Returns a function that should be called to unsubscribe from the subscription.
An onSubscription function may be provided, which is guaranteed to run after the subscription has completed but before any events are emitted to the eventHandler.
All subscriptions are automatically cancelled when the form manager is destroyed.
Throws
If path matches no schema paths.