neurosnap / robodux

caching in redux made simple
MIT License
101 stars 7 forks source link

Better type inference interface not required #10

Closed Dudeonyx closed 5 years ago

Dudeonyx commented 5 years ago

As the name implies, actions interfaces are now simpler and not required, Slice state is inferred from initial state. Also selectors now have a fixed name: getSlice, this is less confusing than alternating between getState and get${slice}, For instance with the old naming system it's hard to predict what the selector of a slice called cData would be, will it be getCData or getCdata ?

Having a fixed name also means typescript is aware of it and can autocomplete it. This also ties in to the additional selectors capability which I've completed(fully typed and autocomplete) but will PR later that if this gets merged