async_extension
1.2.24, released 2 weeks ago by an unverified publisher
Dart async extensions for Future, FutureOr, and performance improvements.
WASM-ready
What it does
Provides extensions and utility functions for Future and FutureOr to optimize synchronous and asynchronous code paths, reduce GC overhead, and add arithmetic operators and try-catch-finally chains for async blocks.
AI-written summary of version 1.2.24, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to interoperate between sync and async code without unnecessary Future allocations
- You need arithmetic operators directly on Future and FutureOr instances
- You want to handle execution chains using utility functions like asyncTry
Skip it when
- You prefer sticking strictly to standard library async/await primitives without third-party extension methods
Strengths
- Improves performance and reduces GC overhead for mixed sync/async computations
- Comprehensive helper methods for FutureOr manipulation and error handling
Weaknesses
- Relies on custom extension paradigms instead of native language primitives
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:async_extension/async_extension.dart';
void doComputation() {
FutureOr<int> n = computeSomething();
var n10 = n.resolveMapped((n) => n * 10);
n10.onResolve((n) => print('n10: $n'));
}Alternatives
Packages that do the same job and could replace async_extension.
Works with
Packages commonly used together with async_extension: ones it builds on, ones built on it, and its own family.
- async_taskBuilt on async_extensionParallel task executor using isolates or async, like thread pools
- bones_apiBuilt on async_extensionA powerful API backend framework for Dart with HTTP server, routing, SQL translator, and DB adapters.
- apollovmBuilt on async_extensionPortable multi-language VM to parse, run, translate, and compile Dart, Java, Kotlin, Go, C#, JS, and Python.
- dart_spawnerBuilt on async_extensionRuns Dart scripts, files, or URIs inside a new Isolate of the current Dart VM.
- async_eventsBuilt on async_extensionA portable asynchronous event hub supporting multiple storage types.
- intl_messagesBuilt on async_extensionMessage internationalization and localization framework with OpenAI translation tools integration.
- dom_toolsBuilt on async_extensionDOM rich elements and tools for CSS, JavaScript, Element Tracking, DOM Manipulation, and Storage.
- async_fieldBuilt on async_extensionAsync fields with observable values, caching and stale handling for any data source