Skip to content

Commit fcf686b

Browse files
committed
fix(docstring): added docstring to store.ts
1 parent 538e98e commit fcf686b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/pinia/src/store.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,22 @@ function createOptionsStore<
213213
return store as any
214214
}
215215

216+
/**
217+
* Create and register a Pinia store implemented with the setup API (core factory).
218+
*
219+
* Builds the reactive store instance, wires its state into the global Pinia state tree,
220+
* wraps actions for $onAction tracking, attaches $patch/$reset/$subscribe/$dispose helpers,
221+
* applies plugins and devtools metadata, and registers the store on the provided Pinia
222+
* instance. Also prepares Hot Module Replacement (HMR) support and optional hydration logic.
223+
*
224+
* @param $id - Unique store id used as the key in pinia.state and for registration.
225+
* @param setup - Store setup function that receives setup helpers and returns state, getters, and actions.
226+
* @param options - Optional store definition/options; used for plugins, getters (options API compatibility), and hydration.
227+
* @param pinia - The Pinia root instance where the store will be registered.
228+
* @param hot - When true, build the store in hot-update mode (uses a temporary hotState and enables HMR-specific wiring).
229+
* @param isOptionsStore - Set to true for stores created from the Options API, so certain setup-store behaviors (like state wiring) are skipped.
230+
* @returns The reactive Store instance is exposing state, getters, actions, and Pinia helpers.
231+
*/
216232
function createSetupStore<
217233
Id extends string,
218234
SS extends Record<any, unknown>,

0 commit comments

Comments
 (0)