scoped_deps 0.1.0+2 copy "scoped_deps: ^0.1.0+2" to clipboard
scoped_deps: ^0.1.0+2 copied to clipboard

A simple Dart library for managing scoped dependencies built on top of Zones from dart:async.

Scoped Deps #

A simple dependency injection library built on Zones.

Quick Start #

import 'package:scoped_deps/scoped_deps.dart';

final value = create(() => 42);

void main() {
  runScoped(scopeA, values: {value});
}

void scopeA() {
  print(read(value)); // 42
  runScoped(scopeB, values: {value.overrideWith(() => 0)});
}

void scopeB() {
  print(read(value)); // 0
}
4
likes
160
pub points
95%
popularity

Publisher

verified publishershorebird.dev

A simple Dart library for managing scoped dependencies built on top of Zones from dart:async.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

meta

More

Packages that depend on scoped_deps