browser-addon icon indicating copy to clipboard operation
browser-addon copied to clipboard

Avoid patching Pinia store with initial state

Open luckyrat opened this issue 1 year ago • 0 comments

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.

luckyrat avatar Feb 08 '23 10:02 luckyrat