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

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

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