the-via / app

GNU General Public License v3.0
816 stars 186 forks source link

Avoid non-serialisable data in store #118

Closed ValdisThomann closed 1 year ago

ValdisThomann commented 1 year ago

This change attempts to remove all non-serialisable data from the redux store.

This should make the redux store more performant and reliable (and rehydratable if we want to). It also removes a bunch of errors from the logs.

ValdisThomann commented 1 year ago

Using a map or an app selector is a better way of fetching the api instance rather than recreating an api instance every time which broke when we used node-hid and likely only works because the shim has a built in cache.

Good idea! Done :)

wilba commented 1 year ago

These changes may also be the fix to a bug where changing the selected device will make both devices flash their LEDs instead of just the new selected device.

If I change line 218 from selectedDevice to api then the bug is gone.