talira

Utility functions and classes related to the dart:async library

open sourceBSD-3-Clausefree

async is the Dart team's package of utilities in the style of dart:async for working with futures and streams. It caches or runs an asynchronous computation once (AsyncCache, AsyncMemoizer), makes operations cancelable (CancelableOperation), waits on a changing group of futures (FutureGroup), and merges, splits, zips and queues streams (StreamGroup, StreamSplitter, StreamZip, StreamQueue), with a Result type that holds either a value or an error. It's published on pub.dev from the dart-lang/core repository.

Problems it solves

  • cancel a Future in Dart when the user leaves the screen
  • merge several Dart streams into one
  • consume a Dart stream one event at a time
  • run an expensive async call once and reuse the result in Flutter

Features

  • cache or run an async computation once
  • cancelable operations
  • stream grouping, splitting, zipping and queueing
  • Result type holding a value or an error
  • delegating wrappers for Future and Stream

Alternatives

The same job

These do what async does.

  1. quiver (Dart) Utility libraries for Dart from Google

Compare async with the top 3