You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, each reducer which contains the map state in some way uses a complete MapRecord to represent those maps. This becomes a problem with some actions which need to update the map state in place (e.g. favoriting or editing a map). Because then, the map state needs to be updated in all the reducers that keep it.
Alternative would be to keep the MapRecord state in a single reducer, and keep the map IDs in all the other reducers. This would allow actions like favoriting or editing a map to only update state in a single place, the maps reducer. However, this new maps reducer would now have to handle all the other actions which fetch maps in some way. Below is the list of all the places we're doing that for now:
map-pools-reducer
lobby-list-reducer
lobby-preferences-reducer
lobby-reducer
maps-reducer (this should be renamed to server-maps-reducer)
matchmaking-preferences-reducer
matchmaking-reducer
So the general maps reducer would have to subscribe to all the actions that are used in the list above and merge their maps with the "global" list of maps that are currently fetched in the app. This includes removing a map from the list if it got deleted (which is possible to do for admins and private maps).
Future improvement: We should also probably handle map deletions in various parts of client UI. For example, what to do if a user deletes a map which is currently hosted in a lobby.
The text was updated successfully, but these errors were encountered:
Currently, each reducer which contains the map state in some way uses a complete MapRecord to represent those maps. This becomes a problem with some actions which need to update the map state in place (e.g. favoriting or editing a map). Because then, the map state needs to be updated in all the reducers that keep it.
Alternative would be to keep the MapRecord state in a single reducer, and keep the map IDs in all the other reducers. This would allow actions like favoriting or editing a map to only update state in a single place, the maps reducer. However, this new maps reducer would now have to handle all the other actions which fetch maps in some way. Below is the list of all the places we're doing that for now:
So the general maps reducer would have to subscribe to all the actions that are used in the list above and merge their maps with the "global" list of maps that are currently fetched in the app. This includes removing a map from the list if it got deleted (which is possible to do for admins and private maps).
Future improvement: We should also probably handle map deletions in various parts of client UI. For example, what to do if a user deletes a map which is currently hosted in a lobby.
The text was updated successfully, but these errors were encountered: