BloomMutation<T, P> constructor
BloomMutation<T, P> ({
- required MutationFn<
T, P> mutateFn, - List? optimisticKey,
- OptimisticUpdater<
T, P> ? optimisticData, - List<
List> invalidateKeys = const [], - OnMutateCallback<
P> ? onMutate, - OnSuccessCallback<
T, P> ? onSuccess, - OnErrorCallback<
P> ? onError, - OnSettledCallback<
T, P> ? onSettled,
Creates a BloomMutation instance with execution hooks and cache invalidation targets.
Implementation
BloomMutation({
required this.mutateFn,
this.optimisticKey,
this.optimisticData,
this.invalidateKeys = const [],
this.onMutate,
this.onSuccess,
this.onError,
this.onSettled,
}) {
_data = signal<T?>(null, debugLabel: 'mutation.data');
_status = signal<MutationStatus>(MutationStatus.idle,
debugLabel: 'mutation.status');
_error = signal<Object?>(null, debugLabel: 'mutation.error');
}