import { createSlice , PayloadAction } from "@reduxjs/toolkit" ; import { PlayerListPlayer } from "@creature-chess/models" ; const initialState = [ ] ; export const { reducer , actions : commands } = createSlice ( { name : "playerlist" , initialState , reducers : { updatePlayerListCommand : ( state , { payload : players } ) => ( [ ... players ] ) } } ) ;