Sawtaytoes
10/7/2018 - 3:36 AM

Logging Loading State

Logging the loading state of a basic reducer.

const logState = () => (
  console.log(
    store
    .getState()
  )
)

logState()
// Initial State
/*
  {
    isLoading: false,
  }
*/

store
.dispatch(
  setLoading()
)

logState()
/*
  {
    isLoading: true,
  }
*/

store
.dispatch(
  setLoaded()
)

logState()
/*
  {
    isLoading: false,
  }
*/