Mutation<T> typedef

Mutation<T> = ({void Function() clear, void Function(Future<T> mutater) mutate, AsyncValue<T>? state})

Represents a mutation, with:

  • state, the current AsyncValue? state of the mutation (will be null when the mutation is inactive/cleared)
  • mutate, a Function that triggers the mutation
  • clear, a Function that stops and clears the mutation

Implementation

typedef Mutation<T> = ({
  AsyncValue<T>? state,
  void Function(Future<T> mutater) mutate,
  void Function() clear,
});