React Async Example (without Redux)

Followup to “You probably don’t need redux”.

My last article lamented the over-use/over-hype of using redux in your react apps. I’m not against redux, but I think react is better when you really understand it before pushing yourself to use redux.

Some feedback about my last article

It got some good feedback, and I wanted to followup and include a vanilla async example to backup my react-without-redux flow.

The Demo — Shows 3 states, not-loaded, loading, loaded.

The Code roughly 40 lines of javascript will cover enough logic for all 3 states. An error state could easily be added with another 10 lines of code. the Rest is visual styling around data existing or not.

testAsync(e) {    
const state =;
if (state.loaded || state.loading) {
// Prevent a duplicate request
// Could also cancel the previous request and start a new one.
return false;
  this.update({ loading: true });
.then(response => response.json())
.then(json => {
this.update({ loaded: true, loading: false, posts: json });
.catch(err => console.log('failed', err)); }

You can compare these with Redux example async request: (notice they place in the advanced folder 😜 )

Let me know what you think? if you have similar problems or examples would love to see them.

If you haven’t already, checkout my original article: