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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I would like to know if we could add a way to map the result from the server action using useOptimistic.
Maybe we could take the returned payload from
onSuccess
?The hook point needs to be here :
next-safe-action/packages/next-safe-action/src/hooks.ts
Lines 79 to 80 in d2ebfc3
I would like to map the
res
.My scenario:
Being able to trigger some side effect in
onSuccess
with side payload and map the result to something different.Two use case:
Beta Was this translation helpful? Give feedback.
All reactions