Skip to content
28 changes: 0 additions & 28 deletions .github/workflows/test-canary.yml

This file was deleted.

90 changes: 0 additions & 90 deletions .github/workflows/trigger-release.yml

This file was deleted.

4 changes: 2 additions & 2 deletions src/mutation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const mutation = (<Data, Error>() =>
startTransition(() =>
setState({ data, isMutating: false, error: undefined })
)
options.onSuccess?.(data as Data, serializedKey, options)
options.onSuccess?.(data as Data, serializedKey, options, arg)
}
return data
} catch (error) {
Expand All @@ -91,7 +91,7 @@ const mutation = (<Data, Error>() =>
startTransition(() =>
setState({ error: error as Error, isMutating: false })
)
options.onError?.(error as Error, serializedKey, options)
options.onError?.(error as Error, serializedKey, options, arg)
if (options.throwOnError) {
throw error as Error
}
Expand Down
6 changes: 4 additions & 2 deletions src/mutation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ export type SWRMutationConfiguration<
key: string,
config: Readonly<
SWRMutationConfiguration<Data, Error, SWRMutationKey, ExtraArg, SWRData>
>
>,
extraArg: ExtraArg
) => void
onError?: (
err: Error,
key: string,
config: Readonly<
SWRMutationConfiguration<Data, Error, SWRMutationKey, ExtraArg, SWRData>
>
>,
extraArg: ExtraArg
) => void
}

Expand Down