singleton<T extends Object> static method
Bind<T>
singleton<T extends Object>(
- T inject(
- Injector i
- bool export = false,
- void onDispose(
- T value
- dynamic selector(
- T value
Bind a 'Singleton' class. Built together with the module. The instance will always be the same.
Implementation
static Bind<T> singleton<T extends Object>(T Function(Injector i) inject,
{bool export = false,
void Function(T value)? onDispose,
dynamic Function(T value)? selector}) {
return Bind<T>(inject,
isSingleton: true,
isLazy: false,
export: export,
onDispose: onDispose,
selector: selector);
}