diff --git a/src/bootstrap/helpers/hooks/use-server-action.ts b/src/bootstrap/helpers/hooks/use-server-action.ts index a4a5034..1d1acb6 100644 --- a/src/bootstrap/helpers/hooks/use-server-action.ts +++ b/src/bootstrap/helpers/hooks/use-server-action.ts @@ -10,7 +10,7 @@ import { useState, useEffect, useTransition, useRef } from "react"; export const useServerAction =

( action: (...args: P) => Promise, onFinished?: (_: R | undefined) => void, -): [(...args: P) => Promise, boolean] => { +): [(...args: P) => Promise, boolean, R | undefined] => { const [isPending, startTransition] = useTransition(); const [result, setResult] = useState(); const [finished, setFinished] = useState(false); @@ -36,5 +36,5 @@ export const useServerAction =

( }); }; - return [runAction, isPending]; + return [runAction, isPending, result]; };