Skip to content

Commit a89423a

Browse files
committed
[form] Rename action implementation function
1 parent 4b9fdfa commit a89423a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/form/src/use-action.svelte.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export type ActionState<E> =
3333
export type ActionsCombinator<E> = (state: ActionState<E>) => boolean | "abort";
3434

3535
export interface ActionOptions<T, R, E = unknown> {
36-
action: (signal: AbortSignal, data: T) => Promise<R>;
36+
do: (signal: AbortSignal, data: T) => Promise<R>;
3737
onSuccess?: (result: R) => void;
3838
onFailure?: (failure: FailedAction<E>) => void;
3939
/**
@@ -138,7 +138,7 @@ export function useAction<T, R, E = unknown>(
138138
status: status === Status.Delayed ? Status.Processed : Status.IDLE,
139139
};
140140
abortController = new AbortController();
141-
const action = options.action(abortController.signal, value).then(
141+
const action = options.do(abortController.signal, value).then(
142142
(result) => {
143143
if (ref?.deref() !== action) return;
144144
state = { status: Status.Success };

0 commit comments

Comments
 (0)