Skip to content

API Documentation / pinia / StoreDefinition

Interface: StoreDefinition<Id, S, G, A>

pinia.StoreDefinition

Return type of defineStore(). Function that allows instantiating a store.

Type parameters

NameType
Idextends string = string
Sextends StateTree = StateTree
G_GettersTree<S>
A_ActionsTree

Callable

StoreDefinition

StoreDefinition(pinia?, hot?): Store<Id, S, G, A>

Returns a store, creates it if necessary.

Parameters

NameTypeDescription
pinia?null | PiniaPinia instance to retrieve the store
hot?StoreGenericdev only hot module replacement

Returns

Store<Id, S, G, A>

Properties

$id

$id: Id

Id of the store. Used by map helpers.

Lançada sob a Licença MIT.

FREE WEEKEND
Unlimited access to Vue.js Developer Certification training
All theory, coding challenges, quizzes + mock exam!
Reserve Your Spot
23-24 August