uncharted-aske / HMI

Apache License 2.0
1 stars 0 forks source link

Refactor store code #439

Open mj3cheun opened 3 years ago

mj3cheun commented 3 years ago

Right now, the store uses hacks to tell the store when certain values are updated. Not only is this fragile and messy, often it doesn't work properly causing friction when developing components using the store and certain hacks such as cloning objects to change the object pointer are both slow inherently and force way more reactive updates than is absolutely necessary.

To solve this issue, the store could be restructured to avoid deep nesting using for example: https://github.com/paularmstrong/normalizr

Either that or find a predictable, dependable way of to make and track changes in deep nested objects/arrays

The following depends on https://github.com/uncharted-aske/HMI/issues/152. If we can move to Vue 3 then we can also update the stores to use JS Map and Set.