Skip to content

Complete guide to

Mastering Pinia

written by its creator

Enumeration: MutationType

Possible types for SubscriptionCallback

Enumeration Members

direct

direct = "direct"

Direct mutation of the state:

  • store.name = 'new name'
  • store.$state.name = 'new name'
  • store.list.push('new item')

Defined in

packages/pinia/src/types.ts:50


patchFunction

patchFunction = "patch function"

Mutated the state with $patch and a function

  • store.$patch(state => state.name = 'newName')

Defined in

packages/pinia/src/types.ts:64


patchObject

patchObject = "patch object"

Mutated the state with $patch and an object

  • store.$patch({ name: 'newName' })

Defined in

packages/pinia/src/types.ts:57

Translated by pinia.vuejs.kr