import { createSelector } from "reselect" ; import { AppState } from "../../../../store" ; const getPlayers = ( state ) => state . game . playerList ; export const getPlayerById = ( id ) => createSelector ( getPlayers , players => players . find ( p => p . id === id ) || null ) ;