Skip to content
Snippets Groups Projects

geo intergation

Merged Leonardo Christino requested to merge feat/get_intergation into main
5 files
+ 44
15
Compare changes
  • Side-by-side
  • Inline
Files
5
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import type { RootState } from './store';
export type HoverType = { [id: string]: any };
export type SelectType = { [id: string]: any };
// Define the initial state using that type
export type InteractionsType = {
hover: HoverType | undefined;
select: SelectType | undefined;
};
export const initialState: InteractionsType = {
hover: {},
select: {},
};
export const interactionSlice = createSlice({
name: 'interaction',
// `createSlice` will infer the state type from the `initialState` argument
initialState,
reducers: {
addHover: (state, action: PayloadAction<HoverType | undefined>) => {
state.hover = action.payload;
},
addSelect: (state, action: PayloadAction<SelectType | undefined>) => {
state.select = action.payload;
},
},
});
export const { addHover, addSelect } = interactionSlice.actions;
export default interactionSlice.reducer;
Loading