Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Latest commit

 

History

History
24 lines (17 loc) · 371 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 371 Bytes

Scoped

A simple dependency injection library built on Zones.

Quick Start

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