...

/

Passing Functions or Strings

Passing Functions or Strings

Let's discuss the possibilities of passing action creator or type constant to our functions.

We'll cover the following...

A common dilemma when using the API middleware approach is deciding whether the onSuccess parameter should be an action creator:

import { setUserData } from '../actions/users';

const fetchUser = id => ({
  type: API,
 
...