Skip to content

Commit 054487c

Browse files
committedApr 20, 2024··
fix: don't push middleware functions in safe client array in use method
1 parent f7eb50c commit 054487c

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed
 

‎packages/next-safe-action/src/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ class SafeActionClient<const ServerError, const Ctx = null, const Metadata = nul
5555
* @returns SafeActionClient
5656
*/
5757
public use<const NextCtx>(middlewareFn: MiddlewareFn<ServerError, Ctx, NextCtx, Metadata>) {
58-
this.#middlewareFns.push(middlewareFn);
59-
6058
return new SafeActionClient<ServerError, NextCtx, Metadata>({
6159
middlewareFns: [...this.#middlewareFns, middlewareFn],
6260
handleReturnedServerError: this.#handleReturnedServerError,

0 commit comments

Comments
 (0)
Please sign in to comment.