SubscriptionClose extension

An extension on the StreamSubscription class that allows you to manage its lifecycle with a HasCloser's Closer. This extension simplifies the process of adding a StreamSubscription to a Closer while hiding the SingleAutoClosable implementation details.

on

Methods

closeWith(HasCloser hasCloser, {void onClose()?}) → void

Available on StreamSubscription, provided by the SubscriptionClose extension

Associates the StreamSubscription with the Closer context. You can provide an optional onClose callback function to define custom actions to be performed when the StreamSubscription is closed.