Skip to content

Commit 200d2f1

Browse files
committed
docs: remove outdated onAction docs
Close #1294
1 parent 7118ea2 commit 200d2f1

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

packages/pinia/src/types.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -198,26 +198,19 @@ export interface _StoreOnActionListenerContext<
198198

199199
/**
200200
* Sets up a hook once the action is finished. It receives the return value
201-
* of the action, if it's a Promise, it will be unwrapped. Can return a
202-
* value (other than `undefined`) to **override** the returned value.
201+
* of the action, if it's a Promise, it will be unwrapped.
203202
*/
204203
after: (
205204
callback: A extends Record<ActionName, _Method>
206-
? (
207-
resolvedReturn: _Awaited<ReturnType<A[ActionName]>>
208-
// allow the after callback to override the return value
209-
) =>
210-
| void
211-
| ReturnType<A[ActionName]>
212-
| _Awaited<ReturnType<A[ActionName]>>
205+
? (resolvedReturn: _Awaited<ReturnType<A[ActionName]>>) => void
213206
: () => void
214207
) => void
215208

216209
/**
217210
* Sets up a hook if the action fails. Return `false` to catch the error and
218211
* stop it fro propagating.
219212
*/
220-
onError: (callback: (error: unknown) => unknown | false) => void
213+
onError: (callback: (error: unknown) => void) => void
221214
}
222215

223216
/**

0 commit comments

Comments
 (0)