diff --git a/website/docs/safe-action-client/instance-methods.md b/website/docs/safe-action-client/instance-methods.md index ddacee4..8bc88c7 100644 --- a/website/docs/safe-action-client/instance-methods.md +++ b/website/docs/safe-action-client/instance-methods.md @@ -64,26 +64,18 @@ Note that when you use `stateAction`, and also want to access `prevResult` in `s ### `serverCodeFn` ```typescript title="Stateless action" -serverCodeFn = (args: { - parsedInput: S extends Schema ? Infer : undefined; - bindArgsParsedInputs: InferArray; - ctx: Ctx; - metadata: MD; -}) => Promise; +serverCodeFn( + args: { parsedInput, bindArgsParsedInputs, ctx, metadata } +) => Promise; ``` ```typescript title="Stateful action" -serverCodeFn = ( - args: { - parsedInput: S extends Schema ? Infer : undefined; - bindArgsParsedInputs: InferArray; - ctx: Ctx; - metadata: MD; - }, - utils: { prevResult: Prettify> } +serverCodeFn = ( + args: { parsedInput, bindArgsParsedInputs, ctx, metadata }, + utils: { prevResult } ) => Promise; ``` -`serverCodeFn` is the async function that will be executed on the **server side** when the action is invoked. If input validation fails, or execution gets halted in a middleware function, the server code function will not be called. +`serverCodeFn` is the async function of type [`ServerCodeFn`](/docs/types#servercodefn)/[`StateServerCodeFn`](/docs/types#stateservercodefn) that will be executed on the **server side** when the action is invoked. If input validation fails, or execution gets halted in a middleware function, the server code function will not be called. In the case of a stateful safe action, `serverCodeFn` will also receive the `prevResult` as a property of the second argument (`utils` object) from the previous action execution, thanks to the [`useStateAction`](/docs/execution/hooks/usestateaction) hook (that uses React's [`useActionState`](https://react.dev/reference/react/useActionState) hook under the hood). \ No newline at end of file