Last active
December 29, 2020 13:55
Revisions
-
naveedahmed986 revised this gist
Dec 29, 2020 . No changes.There are no files selected for viewing
-
naveedahmed986 created this gist
Dec 29, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ import {createStore} from 'redux' // Action Type const LOADER = 'LOADER' // Action export const setLoader = (loading) => { return { type : LOADER, payload : loading } } // Reducer const initialState = { isLoading: false } const loadingActionReducer = (state = initialState, action) => { switch(action.type) { case LOADER: return { ...state, isLoading : action.payload } default: return state } } //Store export const store = createStore(loadingActionReducer)