You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`execute`|`(input: InferIn<S>) => void`| An action caller with no return. The input is the same as the safe action you passed to the hook. |
128
+
|`input`|`InferIn<S> \| undefined`| The input passed to the `execute` function. |
128
129
|`result`|[`HookResult`](/docs/types#hookresult)| When the action gets called via `execute`, this is the result object. |
129
130
|`status`|[`HookActionStatus`](/docs/types#hookresult)| The action current status. |
130
-
|`reset`|`() => void`| You can programmatically reset the `result` object with this function.|
131
+
|`reset`|`() => void`| Programmatically reset `input` and `result` object with this function. |
131
132
|`optimisticData`|`Data` (return type of the `safeActionFn` you passed as first argument) | This is the data that gets updated immediately after `execute` is called, with the behavior you defined in the `reducer` function hook argument. The initial state is what you provided to the hook via `initialOptimisticData` argument. |
132
133
133
134
Explore a working example [here](<https://github.com/TheEdoRan/next-safe-action/tree/main/apps/playground/src/app/(examples)/optimistic-hook>).
0 commit comments