paulkoerbitz / typeful-redux

A typesafe, low-boilerplate wrapper around redux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add redux-thunk to examples

breathe opened this issue · comments

Hi -- I was just perusing your library considering it. Its not immediately obvious to me whether the library as described would work with redux-thunk (or how exactly the types would look if it does).

Would it be reasonable to augment the example's in readme to include example of how this library looks when using redux-thunk?

Hi - thanks for the report. The cold truth is that this lib currently doesn't work well with redux-thunk.

I'm currently working on an API update leveraging TypeScripts 2.8 feature which makes a lot of things a lot easier. With that it should work pretty well with redux-saga, giving TypeChecking to their effect system (put, take, etc. ).

For redux thunk the challenge is that to make it fully type safe, I think you have to refer to the store / action types while defining them. I haven't figured out how to do that.