From 7cc91b6d104bdd0aa564c3339f449284b1cdd041 Mon Sep 17 00:00:00 2001 From: Marin Atanasov Date: Tue, 23 May 2023 12:04:39 +0300 Subject: [PATCH] Document internal property usage --- packages/data/src/redux-store/metadata/selectors.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/data/src/redux-store/metadata/selectors.js b/packages/data/src/redux-store/metadata/selectors.js index 8e8f41ea7cada..22112b0802d15 100644 --- a/packages/data/src/redux-store/metadata/selectors.js +++ b/packages/data/src/redux-store/metadata/selectors.js @@ -141,6 +141,13 @@ export function getCachedResolvers( state ) { */ export function hasResolvingSelectors( state ) { return Object.values( state ).some( ( selectorState ) => + /** + * This uses the internal `_map` property of `EquivalentKeyMap` for + * optimization purposes, since the `EquivalentKeyMap` implementation + * does not support a `.some()` implementation. + * + * @see https://github.com/aduth/equivalent-key-map + */ [ ...selectorState._map.values() ].some( ( resolution ) => resolution[ 1 ]?.status === 'resolving' )