ilkersevim_disposables 0.1.0 copy "ilkersevim_disposables: ^0.1.0" to clipboard
ilkersevim_disposables: ^0.1.0 copied to clipboard

DisposableBag, subscription/timer handle managers, and the TimerDisposable contract for Dart resource lifecycle cleanup.

ilkersevim_disposables #

Centralized disposable resource helpers for Dart: a bag for sync/async cleanup, subscription and timer-handle managers, and the TimerDisposable contract. Dependency-free beyond the Dart SDK.

License: Apache-2.0. Issues: github.com/redjadet/ilkersevim_disposables/issues.

Installation #

dependencies:
  ilkersevim_disposables: ^0.1.0

Requires Dart >=3.12.0.

Usage #

import 'package:ilkersevim_disposables/ilkersevim_disposables.dart';

final bag = DisposableBag();
bag.addSync(() { /* cleanup */ });
await bag.dispose();

final subs = SubscriptionManager();
subs.register(stream.listen(...));
await subs.dispose();

final timers = TimerHandleManager();
timers.register(handle);
await timers.dispose();

API #

  • mixin TimerDisposable { void dispose(); }
  • DisposableBag — register sync/async dispose actions, subscriptions, controllers, and TimerDisposable handles
  • SubscriptionManager — track StreamSubscriptions with clear/dispose
  • TimerHandleManager — track TimerDisposable handles with clear/dispose
1
likes
0
points
311
downloads

Publisher

unverified uploader

Weekly Downloads

DisposableBag, subscription/timer handle managers, and the TimerDisposable contract for Dart resource lifecycle cleanup.

Repository (GitHub)
View/report issues

Topics

#async #lifecycle #dart

License

unknown (license)

More

Packages that depend on ilkersevim_disposables