Skip to content
Snippets Groups Projects
Commit 061ceafa authored by Chris Beer's avatar Chris Beer
Browse files

Don't construct new objects in selector inputs

parent cefe7b7b
No related branches found
No related tags found
No related merge requests found
......@@ -113,9 +113,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,
);
/**
......@@ -128,9 +128,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)
),
);
......@@ -148,9 +148,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,
);
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment