Skip to content

Best practice for updating Pinia state? #1264

Closed Answered by posva
brandonleichty asked this question in Help and Questions
Discussion options

You must be logged in to vote

It was rather a pattern than a best practice.

In pinia you don’t create an action to just change the state. You can use $patch to directly change the state. You can directly change the state in components as well.

Replies: 5 comments 11 replies

Comment options

You must be logged in to vote
5 replies
@antoniogiroz
Comment options

@js-writer
Comment options

@antlionguard
Comment options

@js-writer
Comment options

@Made-of-Clay
Comment options

Answer selected by brandonleichty
Comment options

You must be logged in to vote
2 replies
@SchDen
Comment options

@Made-of-Clay
Comment options

Comment options

You must be logged in to vote
1 reply
@Made-of-Clay
Comment options

Comment options

You must be logged in to vote
1 reply
@Made-of-Clay
Comment options

Comment options

You must be logged in to vote
2 replies
@Made-of-Clay
Comment options

@q-rault
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet