ramp4-pcar4 / storylines-editor

An editor for RAMP Storylines
5 stars 13 forks source link

Explore leveraging Vuex for cleaner state management #365

Open yileifeng opened 4 months ago

yileifeng commented 4 months ago

Description

Haven't put too much thought into the crux of the issue, but am proposing the idea of seeing if we can utilize Vuex to manage config properties and other state. Would be a code refactor but would be worth pursuing if determined to be beneficial for accessing/updating config across the entire app.

The example that prompted me to think about this was when we pass the slide config from the editor.vue to the slide-editor.vue which is then passed to subchild components such as the custom.editor.vue. In order to update this config, two emits are then required to pass the newly updated config back up to the editor.vue, which feels like bad code design.

mohsin-r commented 3 months ago

Would just like to add here that if this refactor does go ahead it might be better to use Pinia as that as is the latest and greatest version of Vuex.