Skip to content
Snippets Groups Projects
Unverified Commit 46e8dcd7 authored by Justin Coyne's avatar Justin Coyne Committed by GitHub
Browse files

Merge pull request #3865 from ProjectMirador/no-new-objects

Don't construct new objects in selector inputs
parents cefe7b7b 061ceafa
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