We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b324cc commit d5bd162Copy full SHA for d5bd162
packages/pinia/src/store.ts
@@ -780,7 +780,15 @@ export type StoreState<SS> =
780
: _ExtractStateFromSetupStore<SS>
781
782
export interface SetupStoreHelpers {
783
- action: <Fn extends _Method>(fn: Fn) => Fn
+ /**
784
+ * Helper that wraps function so it can be tracked with $onAction when the
785
+ * action is called **within the store**. This helper is rarely needed in
786
+ * applications. It's intended for advanced use cases like Pinia Colada.
787
+ *
788
+ * @param fn - action to wrap
789
+ * @param name - name of the action. Will be picked up by the store at creation
790
+ */
791
+ action: <Fn extends _Method>(fn: Fn, name?: string) => Fn
792
}
793
794
/**
0 commit comments