scoped<T extends Object> static method

Bind<T> scoped<T extends Object>(
  1. T inject(
    1. Injector i
    ), {
  2. bool export = false,
  3. void onDispose(
    1. T
    )?,
})

Create single instance for request.

Implementation

static Bind<T> scoped<T extends Object>(T Function(Injector i) inject,
    {bool export = false, void Function(T)? onDispose}) {
  return Bind<T>(inject,
      isSingleton: true,
      isLazy: true,
      isScoped: true,
      export: export,
      onDispose: onDispose);
}