Skip to main content

deferly 1.0.0 copy "deferly: ^1.0.0" to clipboard
deferly: ^1.0.0 copied to clipboard

Go-style defer and recover for Dart. Register cleanup actions that run in LIFO order when a sync or async function exits, and recover from errors.

Use this package as a library

Depend on it

Run this command:

With Dart:

 $ dart pub add deferly

With Flutter:

 $ flutter pub add deferly

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  deferly: ^1.0.0

Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:deferly/deferly.dart';
0
likes
160
points
777
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Go-style defer and recover for Dart. Register cleanup actions that run in LIFO order when a sync or async function exits, and recover from errors.

Repository (GitHub)
View/report issues

Topics

#defer #cleanup #resource-management #async #error-handling

License

MIT (license)

More

Packages that depend on deferly