ReactFoo 2017

A conference on React

Sidhartha Chatterjee

@sidharthachatterjee

Consuming services reliably in Redux without losing your mind

Submitted Mar 16, 2017

With most apps being built with React these days and Redux being a very popular state management library, have we identified a standard pattern for consuming APIs?

What about JWT, automatic retries, caching, optimistic updates and handing failure?

This talk approaches all of the above and identifies reusable patterns to make this a breeze.

Outline

Problem Statement

We identify potential issues with the most common ways of consuming services, in componentDidMount.

How do we fix this

  • we write simple middleware to handle API calls and define a standard for actions that trigger this
  • we build a mechanism for handling JWT with automatic token refresh and storage
  • we build an automatic failure and retry mechanism
  • we add caching into the mix

Conclusion

It looks like we just built a really reliable web app, folks.

Speaker bio

Sidhartha is a software developer and entrepreneur with a passion for finding elegant solutions to hard problems, and tiramisu.

He has previously worked for Insider.in where he built much of the complex microservices and setup infrastructure.

Besides functional programming and DevOps, he has special interests in serverless computing. On Sundays, you’ll find him playing the guitar or walking his dog, Love.

Comments

{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}

Hosted by

A community - for and of - front-end engineers to share experiences with ReactJS, performant apps with React, crafting better User Interfaces (UI) with React and GraphQL ecosystem. ReactFoo also discusses design patterns and user experience. more