Writing Better #redux’s Code with #typescript
▻https://hackernoon.com/writing-better-reduxs-code-with-typescript-b7a3c1209bca?source=rss----3a
TypeScript typings power, when used properly, could help us write better code. This article is about how to use TypeScript type system with Redux to create fully typed state management store.I assume that you already know redux and maybe a little bit of TypeScript. I appreciate any inputs, I only tried implementing this recently and I am open to any improvements. This is a highly opinionated and subjective article.I used to write Redux in JS, and then define its actions and types as constants. It is not unusual for me to see something like this.▻https://medium.com/media/35bec13bf0ddb0af1fe08dca69855d07/hrefThe problem with the code above was, well, AUTH_TYPES
can’t be changed as a whole, but this could happen.▻https://medium.com/media/510154afa7c8e27bf94b324d4e7eb728/hrefWell, we can fix (...)