generalui / hooks-for-redux

modular redux - in half the code
MIT License
96 stars 13 forks source link

TS Definitions file #1

Closed bohdanbirdie closed 4 years ago

bohdanbirdie commented 4 years ago

I find articles as a way to promote open source work a pretty effective way of doing it, good job!

Any plans adding TS types for the folks? 😄

shanebdavis commented 4 years ago

Hi B! I'm sorry I missed this.

TS support is already built in. The TypeScript was somewhat tricky, so I implemented it as a separate file, but as a client, you shouldn't notice any difference. When you create a redux-slice with the "useRedux" command, the returned react-hook, dispatchers, and virtual-store are all automatically typed.

You can view the Types here: https://github.com/generalui/hooks-for-redux/blob/master/index.d.ts