krazkidd / lineup

Softball lineup editor made with Nuxt 3 (Vue.js 3)
https://lineup.app.xericode.net
GNU Affero General Public License v3.0
3 stars 2 forks source link

Encapsulate app state in a Pinia store #2

Closed krazkidd closed 10 months ago

krazkidd commented 10 months ago

This provides reactive app state through a Pinia store and persists preferences to the browser's local storage.

The implementation is a bit of a hack because I couldn't get the state props to be reactive and persisted to local storage under a universal rendering scheme (i.e., with SSR turned on). However, I provide an alternative implementation that may work if Pinia comes to support SSR better. To watch for upstream enhancements, see https://github.com/vuejs/pinia/issues/829.