Example
export const loadClassrooms = () => (dispatch, getState) => {
const state = getState()
classroomsApi({ token: state.user.token })
.getClassrooms()
.then(classrooms => {
dispatch(
set({
isLoading: false,
classrooms: {
...state.schoolSetup.classrooms,
classrooms
}
})
)
})
}