bootstack.events.Subscription#

class bootstack.events.Subscription(widget, sequence, bind_id)#

Bases: object

Handle returned by widget.on(...). Cancels the binding when .cancel() is called or the context manager exits.

Idempotent: calling cancel() more than once is a no-op.

property cancelled: bool#

Whether cancel() has completed for this subscription.

cancel()#

Remove the binding. Safe to call more than once, and on a dead widget.

cancelled afterwards means the removal was carried out as far as this handle can carry it — the handler will not be delivered to again through this subscription.