Commit Graph
4 Commits
Author SHA1 Message Date
David Lechner a9f4eaa32d actions: simplify usage of Matchable
This removes use of the pseudo-internal toString() function and also
removes extraneous uses of ReturnType<>. Also, a new when() method
is added to simplify additional uses.
2022-02-26 12:43:10 -06:00
David Lechner 9641898a75 actions: refactor actions
The pattern we were using for actions required actions to be defined in
three places, an enum member containing the type string, an type
definition and a function. This combines all three of these into one by
using a helper function based on the ideas from [1].

[1]: https://phryneas.de/redux-typescript-no-discriminating-union
2022-02-25 17:58:30 -06:00
David Lechner 0c20e52a45 don't allow optional args in actions
This can lead to subtle bugs.

Fixes firmware flash button not working.
2021-02-01 10:26:05 -06:00
David Lechner 6f204a65f6 reorganize src/ directory
Makes for much less scrolling/jumping around.

https://redux.js.org/style-guide/style-guide#structure-files-as-feature-folders-or-ducks
2021-02-01 10:26:05 -06:00