run abstract method

Future<ResultT> run(
  1. MutationTarget target,
  2. Future<ResultT> cb(
    1. MutationTransaction transaction
    )
)

Starts a mutation and set its state based on the result of the callback.

This sets the mutation state to MutationPending, call the callback, then set the mutation state to either MutationSuccess or MutationError depending on whether the callback completes successfully or throws an error.

While within the callback, use MutationTransaction to interact with providers. When doing so, run will naturally keep the providers alive for the duration of the callback, and close any pending subscriptions after it completes.

Implementation

Future<ResultT> run(
  MutationTarget target,
  Future<ResultT> Function(MutationTransaction transaction) cb,
);