Home > @pago/reactive > SubscriptionController

SubscriptionController class

Manages the subscription to tracked references and objects within a memoized function.

Signature:

export declare class SubscriptionController 

Constructors

Constructor Modifiers Description
(constructor)(effect)   Creates a new SubscriptionController.

Properties

Property Modifiers Type Description
cleanup?   Effect (Optional) A cleanup effect that should be executed before the effect is executed again or on unsubscribe.
effect   Effect The effect that is triggered whenever a tracked value changes after the controller has subscribed to changes.

Methods

Method Modifiers Description
subscribe()   Subscribes to the set of tracked references and objects. Once subscribed, the SubscriptionController.effect will be triggered whenever any of the values change.
unsubscribe()   Unsubscribes from all tracked values.