API Documentation / pinia / SetupStoreDefinition
Interface: SetupStoreDefinition<Id, SS>
pinia.SetupStoreDefinition
Return type of defineStore()
with a setup function.
Id
is a string literal of the store's nameSS
is the return type of the setup function
See
Type parameters
Name | Type |
---|---|
Id | extends string |
SS | SS |
Hierarchy
StoreDefinition
<Id
,_ExtractStateFromSetupStore
<SS
>,_ExtractGettersFromSetupStore
<SS
>,_ExtractActionsFromSetupStore
<SS
>>↳
SetupStoreDefinition
Callable
SetupStoreDefinition
▸ SetupStoreDefinition(pinia?
, hot?
): Store
<Id
, _ExtractStateFromSetupStore
<SS
>, _ExtractGettersFromSetupStore
<SS
>, _ExtractActionsFromSetupStore
<SS
>>
Returns a store, creates it if necessary.
Parameters
Name | Type | Description |
---|---|---|
pinia? | null | Pinia | Pinia instance to retrieve the store |
hot? | StoreGeneric | dev only hot module replacement |
Returns
Store
<Id
, _ExtractStateFromSetupStore
<SS
>, _ExtractGettersFromSetupStore
<SS
>, _ExtractActionsFromSetupStore
<SS
>>
Properties
$id
• $id: Id
Id of the store. Used by map helpers.