Skip to content

Commit 813e6bd

Browse files
committed
fix onComplete return type
1 parent 453d20b commit 813e6bd

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/odd-hounds-tell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/router": patch
3+
---
4+
5+
fix `onComplete` return type

src/data/action.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ export function action<T extends Array<any>, U = void>(
7272
): Action<T, U>;
7373
export function action<T extends Array<any>, U = void>(
7474
fn: (...args: T) => Promise<U>,
75-
options?: { name?: string; onComplete?: (s: Submission<T, U>) => boolean }
75+
options?: { name?: string; onComplete?: (s: Submission<T, U>) => void }
7676
): Action<T, U>;
7777
export function action<T extends Array<any>, U = void>(
7878
fn: (...args: T) => Promise<U>,
79-
options: string | { name?: string; onComplete?: (s: Submission<T, U>) => boolean } = {}
79+
options: string | { name?: string; onComplete?: (s: Submission<T, U>) => void } = {}
8080
): Action<T, U> {
8181
function mutate(this: { r: RouterContext; f?: HTMLFormElement }, ...variables: T) {
8282
const router = this.r;
@@ -92,7 +92,7 @@ export function action<T extends Array<any>, U = void>(
9292
return async (res: any) => {
9393
const result = await handleResponse(res, error, router.navigatorFactory());
9494
let retry = null;
95-
!o.onComplete?.({
95+
o.onComplete?.({
9696
...submission,
9797
result: result?.data,
9898
error: result?.error,

0 commit comments

Comments
 (0)