othr
This commit is contained in:
23
src/features/uiSlice.ts
Normal file
23
src/features/uiSlice.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import {createSlice, PayloadAction} from "@reduxjs/toolkit";
|
||||
|
||||
interface UIState {
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
const initialState: UIState = {
|
||||
isLoading: false
|
||||
}
|
||||
|
||||
const uiSlice = createSlice({
|
||||
name: 'ui',
|
||||
initialState,
|
||||
reducers: {
|
||||
setIsLoading: (state, action: PayloadAction<boolean>) => {
|
||||
state.isLoading = action.payload;
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
export default uiSlice.reducer;
|
||||
export const {setIsLoading} = uiSlice.actions;
|
||||
Reference in New Issue
Block a user