turkmen-expo/redux/slices/headerSlice.ts

27 lines
568 B
TypeScript
Raw Normal View History

2025-10-12 17:42:17 +00:00
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import { RootState } from '../store';
interface HeaderState {
showInput: boolean;
}
const initialState: HeaderState = {
showInput: false,
};
const headerSlice = createSlice({
name: 'header',
initialState,
reducers: {
setShowInput(state, action: PayloadAction<boolean>) {
state.showInput = action.payload;
},
},
});
export const selectHeader = (state: RootState) => state.headerSlice;
export const { setShowInput } = headerSlice.actions;
2025-10-12 17:42:17 +00:00
export default headerSlice.reducer;