From: Eduardo San Martin Morote Date: Fri, 7 Mar 2025 14:08:19 +0000 (+0100) Subject: docs: add description to the action helper X-Git-Tag: @pinia/nuxt@0.11.0~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5bd1628b396c6d8cdd530906cdc8e77f0347782;p=thirdparty%2Fvuejs%2Fpinia.git docs: add description to the action helper --- diff --git a/packages/pinia/src/store.ts b/packages/pinia/src/store.ts index a7be113c..bed44b20 100644 --- a/packages/pinia/src/store.ts +++ b/packages/pinia/src/store.ts @@ -780,7 +780,15 @@ export type StoreState = : _ExtractStateFromSetupStore export interface SetupStoreHelpers { - action: (fn: Fn) => Fn + /** + * Helper that wraps function so it can be tracked with $onAction when the + * action is called **within the store**. This helper is rarely needed in + * applications. It's intended for advanced use cases like Pinia Colada. + * + * @param fn - action to wrap + * @param name - name of the action. Will be picked up by the store at creation + */ + action: (fn: Fn, name?: string) => Fn } /**