Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid patching Pinia store with initial state #326

Open
luckyrat opened this issue Feb 8, 2023 · 0 comments
Open

Avoid patching Pinia store with initial state #326

luckyrat opened this issue Feb 8, 2023 · 0 comments

Comments

@luckyrat
Copy link
Member

luckyrat commented Feb 8, 2023

Sometimes we call store.$patch(m.initialState); which works but it might be faster to instead find a way to supply Pinia with the initial state before we create the store. The previous Vuex store approach with automatic Mutation handling couldn't support this optimisation but I'm hopeful we can make it work now.

Maybe we need to use a PiniaPlugin to supply a runtime default state to the store definition function.

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

No branches or pull requests

1 participant