You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
617 B
TypeScript
25 lines
617 B
TypeScript
2 months ago
|
import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
|
||
|
|
||
|
export interface DebugState {
|
||
|
debugMode: boolean;
|
||
|
}
|
||
|
|
||
|
export const initialDebugState = {
|
||
|
debugMode: false,
|
||
|
};
|
||
|
|
||
|
const debugSlice = createSlice({
|
||
|
name: 'debug',
|
||
|
initialState: initialDebugState,
|
||
|
reducers: {
|
||
|
setDebugMode: (state, action: PayloadAction<boolean>) => {
|
||
|
(window as Window).sessionFeatureFlags.debug.debugLogging = action.payload;
|
||
|
return { ...state, debugMode: action.payload };
|
||
|
},
|
||
|
},
|
||
|
});
|
||
|
|
||
|
const { actions, reducer } = debugSlice;
|
||
|
export const { setDebugMode } = actions;
|
||
|
export const debugReducer = reducer;
|