Reference:

https://github.com/reduxjs/reselect

 

Example of using reselect to combine two selects

export const selectBrowseGamesWithWish = createSelector(
  [selectBrowseGames, selectWishlistGameIds],
  (browseGames, wishlistIds) =>
    browseGames.map((game) => ({
      ...game,
      status: wishlistIds.some((wished) => game.id === wished.gameId)
        ? 'WISHLISTED'
        : undefined,
    }))
)