24 lines
521 B
TypeScript
24 lines
521 B
TypeScript
import type { PayloadAction } from '@reduxjs/toolkit'
|
|
|
|
import { createSlice } from '@reduxjs/toolkit'
|
|
|
|
interface StateType {
|
|
value: boolean | null
|
|
}
|
|
|
|
const initialValue: StateType = {
|
|
value: null
|
|
}
|
|
|
|
export const isMobileSlice = createSlice({
|
|
name: 'menu-open',
|
|
initialState: initialValue,
|
|
reducers: {
|
|
set: (state, action: PayloadAction<boolean>) => {
|
|
state.value = action.payload
|
|
}
|
|
}
|
|
})
|
|
export const { set } = isMobileSlice.actions
|
|
export default isMobileSlice.reducer
|