From 8c02541edaf8db3e7b1e433259e1db5844b0542f Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Thu, 14 Dec 2023 11:31:44 -0800 Subject: [PATCH] Don't construct new objects in selector inputs --- src/state/selectors/companionWindows.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/state/selectors/companionWindows.js b/src/state/selectors/companionWindows.js index 914c73a2f..c86d9de83 100644 --- a/src/state/selectors/companionWindows.js +++ b/src/state/selectors/companionWindows.js @@ -98,9 +98,9 @@ const getCompanionWindowIdsOfWindow = createSelector( export const getCompanionWindowsForPosition = createSelector( [ getCompanionWindowsOfWindow, - (state, { position }) => ({ position }), + (state, { position }) => (position), ], - (companionWindows, { position }) => companionWindows[position] || EMPTY_ARRAY, + (companionWindows, position) => companionWindows[position] || EMPTY_ARRAY, ); /** @@ -113,9 +113,9 @@ export const getCompanionWindowsForPosition = createSelector( export const getCompanionWindowsForContent = createSelector( [ getCompanionWindowsOfWindow, - (state, { content }) => ({ content }), + (state, { content }) => (content), ], - (companionWindows, { content }) => ( + (companionWindows, content) => ( [].concat(...Object.values(companionWindows)).filter(w => w.content === content) ), ); @@ -126,9 +126,9 @@ const EMPTY_ARRAY = []; export const getCompanionWindowIdsForPosition = createSelector( [ getCompanionWindowIdsOfWindow, - (state, { position }) => ({ position }), + (state, { position }) => (position), ], - (companionWindowIds, { position }) => companionWindowIds[position] || EMPTY_ARRAY, + (companionWindowIds, position) => companionWindowIds[position] || EMPTY_ARRAY, ); /**