RobotsAndPencils / react-gantry

R&P's React Starter Kit
4 stars 1 forks source link

Default Async behavior? #28

Closed akrigline closed 3 years ago

akrigline commented 6 years ago

Wondering if Gantry should set up a default structure for handling async calls.

For Example:

  1. dispatch REQUEST_START before any axios call
    • Starts a spinner component
  2. dispatch REQUEST_SUCCESS when the call is successful
    • Stops the Spinner
  3. dispatch REQUEST_ERROR when the call errors
    • Stops Spinner
    • Displays Error via alert or something.

I think too often this sort of behavior isn't included right off the bat (at least in projects I've been part of), and it's standardizable enough to warrant some Gantry involvement IMO.