Table of Contents

Interface IMutation<TArgs, TData>

Namespace
DotNetQuery.Core
Assembly
DotNetQuery.Core.dll

Represents a mutation that executes a side-effecting operation with TArgs and produces TData as a result.

public interface IMutation<TArgs, TData> : IDisposable

Type Parameters

TArgs

The type of the arguments passed to the mutation.

TData

The type of the data returned on success.

Inherited Members

Properties

Failure

Emits the Exception on each failed execution.

IObservable<Exception> Failure { get; }

Property Value

IObservable<Exception>

Settled

Emits the final MutationState<TData> after each execution completes, regardless of whether it succeeded or failed.

IObservable<MutationState<TData>> Settled { get; }

Property Value

IObservable<MutationState<TData>>

State

Emits on every state transition (e.g. Idle → Executing → Success/Failed). Replays the latest state to new subscribers.

IObservable<MutationState<TData>> State { get; }

Property Value

IObservable<MutationState<TData>>

Success

Emits the unwrapped TData on each successful execution.

IObservable<TData> Success { get; }

Property Value

IObservable<TData>

Methods

Cancel()

Cancels the currently running execution, if any.

void Cancel()

Execute(TArgs)

Triggers the mutation with the given args. If the mutation is disabled, the call is silently ignored.

void Execute(TArgs args)

Parameters

args TArgs

The arguments to pass to the mutation handler.

SetEnabled(bool)

Enables or disables the mutation. When false, calls to Execute(TArgs) are silently ignored. Pass true to allow subsequent executions.

void SetEnabled(bool enabled)

Parameters

enabled bool