A simple generic reducer to say if you're in a loading state or not.
import { createReducer } from '@ghadyani-framework/redux-utils'
import {
LOADED,
LOADING,
} from './actions'
export const initialState = false
export const reducerActions = {
[LOADED]: () => false,
[LOADING]: () => true,
}
const isLoadingReducer = (
createReducer(
reducerActions,
initialState,
)
)
export default isLoadingReducer