Skip to content

Commit

Permalink
fix: don't push middleware functions in safe client array in use me…
Browse files Browse the repository at this point in the history
…thod
  • Loading branch information
TheEdoRan committed Apr 20, 2024
1 parent f7eb50c commit 054487c
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions packages/next-safe-action/src/index.ts
Expand Up @@ -55,8 +55,6 @@ class SafeActionClient<const ServerError, const Ctx = null, const Metadata = nul
* @returns SafeActionClient
*/
public use<const NextCtx>(middlewareFn: MiddlewareFn<ServerError, Ctx, NextCtx, Metadata>) {
this.#middlewareFns.push(middlewareFn);

return new SafeActionClient<ServerError, NextCtx, Metadata>({
middlewareFns: [...this.#middlewareFns, middlewareFn],
handleReturnedServerError: this.#handleReturnedServerError,
Expand Down

0 comments on commit 054487c

Please sign in to comment.