jsaelhof / guitar-dashboard

A web-based dashboard for controlling music and sheet music while practicing
0 stars 0 forks source link

Return less data #30

Open jsaelhof opened 1 week ago

jsaelhof commented 1 week ago

When the server is updated (i.e. a new volume is set, a loop is added etc), the server returns the whole song data back. That's inefficient but it also created a problem when I added the cover image to the initial song get response as future calls didn't have this data and it would disappear from state. I'm now using overlaying new state on top of existing state so I no longer need to return everything and can just return the modified data. I need a better deep-merge on the FE action to handle this too.

jsaelhof commented 1 day ago

Deepmerge is in. If I do this, I need to consider the array merge function which currently overwrites.

jsaelhof commented 1 day ago

Do I want to do this? I need to read up on the best practices for returning mutated objects in Apollo and use the same mentality here (even though I don't have apollo/grahpql, the theory should apply).