Skip to content

Commit

Permalink
chore(website): update hooks documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEdoRan committed May 15, 2024
1 parent 1576a5a commit ea1b083
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion website/docs/execution/hooks/callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Hook callbacks are a way to perform custom logic based on the curre

# Callbacks

Hook callbacks are a way to perform custom logic based on the current action execution status. You can provide them both to `useAction` and `useOptimisticAction` in the last optional argument, which is an object. All of them are optional:
Hook callbacks are a way to perform custom logic based on the current action execution status. You can provide them to the three hooks in the `utils` object, which is the second argument. All of them are optional:

```tsx
const action = useAction(testAction, {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/execution/hooks/check-action-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Learn how to check the current action status when using hooks.

There are two ways to get the current action status when using hooks:

1. Directly via the `status` property returned by `useAction` and `useOptimisticAction` hooks.
1. Directly via the `status` property returned by the three hooks.
2. Using utility functions imported from `next-safe-action/status`.

## Utility functions
Expand Down
2 changes: 1 addition & 1 deletion website/docs/execution/hooks/useoptimisticaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function AddLikes({ likesCount }: Props) {
currentData: { likesCount }, // gets passed from Server Component
updateFn: (prevData, { incrementBy }) => {
return {
likesCount: prevData.numOfLikes + amount
likesCount: prevData.likesCount + amount
};
}
}
Expand Down

0 comments on commit ea1b083

Please sign in to comment.