Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 1.54 KB

README.md

File metadata and controls

42 lines (33 loc) · 1.54 KB

Scoped

A simple dependency injection library built on Zones.

codecov


Quick Start

import 'package:scoped_zone/scoped.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
}