| 1 |
import { createSlice } from '@reduxjs/toolkit'; |
| 2 |
|
| 3 |
const initialState = { |
| 4 |
showEditor: false, |
| 5 |
componentToEdit: '', |
| 6 |
saveStatus: 'saved', |
| 7 |
}; |
| 8 |
|
| 9 |
export const interactionSlice = createSlice({ |
| 10 |
name: 'interaction', |
| 11 |
initialState, |
| 12 |
reducers: { |
| 13 |
setShowEditor: (state, action) => { |
| 14 |
state.showEditor = action.payload; |
| 15 |
}, |
| 16 |
setComponentToEdit: (state, action) => { |
| 17 |
state.componentToEdit = action.payload; |
| 18 |
}, |
| 19 |
setSaveStatus: (state, action) => { |
| 20 |
state.saveStatus = action.payload; |
| 21 |
}, |
| 22 |
}, |
| 23 |
}); |
| 24 |
|
| 25 |
export const { setShowEditor, setComponentToEdit, setSaveStatus } = |
| 26 |
interactionSlice.actions; |
| 27 |
export default interactionSlice.reducer; |
| 28 |
|