DynamicSubscription

Represents a subscription that can be turned on and off repeatedly. For example, in Laminar the elements can be mounted and unmounted repeatedly, and so their subscriptions are activated and deactivated respectively when those events happen.

In contrast, the only thing you can do to a non-dynamic Subscription is kill it, and once that is done, it will remain dead forever.

Note that the dynamic subscription is NOT activated automatically upon creation.

The subscription created by activate must not be killed externally, otherwise DynamicSubscription will throw when it tries to kill it and it's already killed.

Value parameters:
activate
  • Note: Must not throw!
prepend
  • If true, dynamic owner will prepend subscription to the list instead of appending. This affects activation and deactivation order of subscriptions.
Companion:
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def isOwnedBy(owner: DynamicOwner): Boolean
def isOwnerActive: Boolean
def kill(): Unit

Permanently kill this subscription, deactivating if it's currently active, and removing it from the dynamic owner

Permanently kill this subscription, deactivating if it's currently active, and removing it from the dynamic owner