]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: remove outdated onAction docs
authorEduardo San Martin Morote <posva13@gmail.com>
Sun, 15 May 2022 09:32:55 +0000 (11:32 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Sun, 15 May 2022 09:33:01 +0000 (11:33 +0200)
Close #1294

packages/pinia/src/types.ts

index 36592ccae3a2a968bb64963ea6f2c5e9ce59db01..35bcae7a7914a2c5470f6ee953f0d636cc1314ea 100644 (file)
@@ -198,18 +198,11 @@ export interface _StoreOnActionListenerContext<
 
   /**
    * Sets up a hook once the action is finished. It receives the return value
-   * of the action, if it's a Promise, it will be unwrapped. Can return a
-   * value (other than `undefined`) to **override** the returned value.
+   * of the action, if it's a Promise, it will be unwrapped.
    */
   after: (
     callback: A extends Record<ActionName, _Method>
-      ? (
-          resolvedReturn: _Awaited<ReturnType<A[ActionName]>>
-          // allow the after callback to override the return value
-        ) =>
-          | void
-          | ReturnType<A[ActionName]>
-          | _Awaited<ReturnType<A[ActionName]>>
+      ? (resolvedReturn: _Awaited<ReturnType<A[ActionName]>>) => void
       : () => void
   ) => void
 
@@ -217,7 +210,7 @@ export interface _StoreOnActionListenerContext<
    * Sets up a hook if the action fails. Return `false` to catch the error and
    * stop it fro propagating.
    */
-  onError: (callback: (error: unknown) => unknown | false) => void
+  onError: (callback: (error: unknown) => void) => void
 }
 
 /**