MCPcopy Create free account
hub / github.com/effect-app/libs / useMakeMutation

Function useMakeMutation

packages/vue/src/mutate.ts:417–431  ·  view source on GitHub ↗
(queryInvalidator: QueryInvalidator<RInvalidator>)

Source from the content-addressed store, hash-verified

415/**
416 * A callable mutation result. When `I = void` the input argument may be omitted.
417 */
418export interface MutationFn<I, A, E, R, Id extends string> {
419 <B = A, E2 = never, R2 = never>(
420 input: I,
421 options?: MutationOptionsBase<A, B, E2, R2>
422 ): Effect.Effect<B, E | E2, R | R2>
423 readonly id: Id
424}
425
426export const makeMutation = <RInvalidator>(queryInvalidator: QueryInvalidator<RInvalidator>) => {
427 /**
428 * Pass a function that returns an Effect, e.g from a client action.
429 * Executes query cache invalidation based on default rules or provided option.
430 * When `I = void` the input argument may be omitted.
431 */
432 const useMutation = <I, E, A, R, Request extends Req, Id extends string>(
433 self: RequestHandlerWithInput<I, A, E, R, Request, Id>
434 ): MutationFn<I, A, E, R, Id> => {

Callers 1

useMutationIntFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…