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,
}
*/