10 Tips for Better Redux Architecture
Eric Elliott
1.6K42

Great article Eric. I’m going through my baptism of fire with Redux at the moment and there is certainly a lot for me to consume here. Could be so bold as to ask you a question related to Redux but not to your article? Perhaps, we could consider it the 11th point.

I working through implementing my actions to make asynchronous calls to make their CRUD calls to the server. At this point in development I haven’t worked out a contract for my calls to the back end so I’m hoping to abstract them away into an api module so I can then just make method calls to get the promises that I can then work with in my action creators. I’m having problems with coming up with ways to keep this testable though. The best I could come up with was to export a property on my action creators module so that in testing I can replace the api with a mock but exposing internals just for the sake of testing feels pretty wrong. I have recently seen some posts suggesting that you can make some middle-ware to inject the api module that way. What approaches have you tried to solve this problem?

Show your support

Clapping shows how much you appreciated Zac Braddy’s story.