aboutsummaryrefslogtreecommitdiff
path: root/modern/src/store/session.js
blob: 9f98b8ae73caf8960d1b97540f58ced4e43caaed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { createSlice } from '@reduxjs/toolkit';

const { reducer, actions } = createSlice({
  name: 'session',
  initialState: {
    server: null,
    user: null,
  },
  reducers: {
    updateServer(state, action) {
      state.server = action.payload;
    },
    updateUser(state, action) {
      state.user = action.payload;
    },
  },
});

export { actions as sessionActions };
export { reducer as sessionReducer };