DEV Community

Discussion on: Practical TypeScript. React + Redux

Collapse
 
surgeboris profile image
surgeboris • Edited

You're using explicit type-casting for thunks in connect function (which is not bad per se, it just feels like a hacky workaround to me).

@types/react-redux@6.0.11 actually includes higher-order-type similar to your CutMiddleFunction and provides a higher-order-type ResolveThunks that servers a purpose similar to your unboxThunk.

Collapse
 
voronar profile image
Kirill Alexander Khalitov • Edited

Thanks. I will watch new built-in types.