Inject<T>.interface constructor

Inject<T>.interface(
  1. Map<dynamic, FutureOr<T> Function()> impl, {
  2. dynamic name,
  3. T? initialValue,
})

Injected a map of flavor

Implementation

factory Inject.interface(
  Map<dynamic, FutureOr<T> Function()> impl, {
  dynamic name,
  // bool isLazy = false,
  T? initialValue,
}) {
  // ignore: deprecated_member_use_from_same_package
  return Inject._(
    ReactiveModel.create(creator: () {
      return RM
          .injectFlavor(
            impl,
            isLazy: false,
            initialState: initialValue,
            autoDisposeWhenNotUsed: false,
          )
          .state;
    }),
    name,
  );
}