Skip to content

API reference > @kontsedal/olas-core > Mutation

Mutation type ​

A running mutation. Created via createMutation(ctx, spec) — the controller owns its lifetime. Each run(vars) returns a Promise; the signals reflect the last-resolved run for UI binding.

Spec §6, §20.5.

Signature:

typescript
type Mutation<V, R> = {
  run: MutationRun<V, R>;
  data: ReadSignal<R | undefined>;
  error: ReadSignal<unknown | undefined>;
  isPending: ReadSignal<boolean>;
  status: ReadSignal<AsyncStatus>;
  lastVariables: ReadSignal<V | undefined>;
  reset(): void;
  dispose(): void;
};

References: MutationRun, ReadSignal, AsyncStatus

Released under the MIT License.