paulkoerbitz / typeful-redux

A typesafe, low-boilerplate wrapper around redux
MIT License
53 stars 4 forks source link

Add redux-thunk to examples #5

Open breathe opened 6 years ago

breathe commented 6 years ago

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?

paulkoerbitz commented 6 years ago

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.