Injected<T>.generic constructor
Injected<T>.generic ({
- required Object? creator(),
- required T? initialState,
- required SideEffects<
T> ? sideEffects, - required StateInterceptor<
T> ? stateInterceptor, - required bool autoDisposeWhenNotUsed,
- required String? debugPrintWhenNotifiedPreMessage,
- required Object? toDebugString(
- T?
- required int undoStackLength,
- required PersistState<
T> persist()?, - required DependsOn<
T> ? dependsOn, - Object? watch(
- T? s
Create an Injected state from any kind of creator
Implementation
factory Injected.generic({
required Object? Function() creator,
required T? initialState,
required SideEffects<T>? sideEffects,
required StateInterceptor<T>? stateInterceptor,
required bool autoDisposeWhenNotUsed,
required String? debugPrintWhenNotifiedPreMessage,
required Object? Function(T?)? toDebugString,
required int undoStackLength,
required PersistState<T> Function()? persist,
required DependsOn<T>? dependsOn,
Object? Function(T? s)? watch,
}) =>
undoStackLength > 0 || persist != null
? InjectedImpRedoPersistState<T>(
creator: creator,
initialState: initialState,
sideEffects: sideEffects,
stateInterceptor: stateInterceptor,
autoDisposeWhenNotUsed: autoDisposeWhenNotUsed,
debugPrintWhenNotifiedPreMessage:
debugPrintWhenNotifiedPreMessage,
toDebugString: toDebugString,
undoStackLength: undoStackLength,
persist: persist,
dependsOn: dependsOn,
watch: watch,
)
: InjectedImp<T>(
creator: creator,
initialState: initialState,
sideEffectsGlobal: sideEffects,
stateInterceptor: stateInterceptor,
autoDisposeWhenNotUsed: autoDisposeWhenNotUsed,
debugPrintWhenNotifiedPreMessageGlobal:
debugPrintWhenNotifiedPreMessage,
toDebugString: toDebugString,
dependsOn: dependsOn,
watch: watch,
);