main
Last change
on this file since ebf5e04 was ebf5e04, checked in by anastasovv <simon@…>, 2 years ago |
Code cleanings
|
-
Property mode
set to
100644
|
File size:
703 bytes
|
Rev | Line | |
---|
[87614a5] | 1 | import { createSlice } from '@reduxjs/toolkit';
|
---|
| 2 |
|
---|
| 3 | const initialState = {
|
---|
| 4 | player: {
|
---|
| 5 | displayName: '',
|
---|
| 6 | username: '',
|
---|
| 7 | session_id: '',
|
---|
| 8 | room_id: '',
|
---|
| 9 | credits: 0,
|
---|
| 10 | },
|
---|
| 11 | game: {
|
---|
| 12 | playerCards: [],
|
---|
| 13 | dealerCards: [],
|
---|
| 14 | status: '',
|
---|
| 15 | sideBetName: '',
|
---|
| 16 | }
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | export const playerSlice = createSlice({
|
---|
| 20 | name: 'player',
|
---|
| 21 | initialState,
|
---|
| 22 | reducers: {
|
---|
| 23 | setPlayer: (state, action) => {
|
---|
| 24 | state.player = action.payload;
|
---|
| 25 | },
|
---|
| 26 | setGame: (state, action) => {
|
---|
| 27 | state.game = action.payload;
|
---|
| 28 | },
|
---|
| 29 | }
|
---|
| 30 | })
|
---|
| 31 |
|
---|
[ebf5e04] | 32 | export const { setPlayer, setGame } = playerSlice.actions
|
---|
[87614a5] | 33 |
|
---|
| 34 | export default playerSlice.reducer |
---|
Note:
See
TracBrowser
for help on using the repository browser.