From 2aefc5b0a587e0839ec67615e2c7fb94f89af6dc Mon Sep 17 00:00:00 2001 From: Marcus Kazmierczak Date: Fri, 9 Apr 2021 05:53:39 -0700 Subject: [PATCH] Fixes return type for getEntitiesByKind (#30639) The return type was specified as boolean, but the data is being passed to the lodash filter function and returning its result which will be an Array not a boolean. Closes #29260 --- packages/core-data/README.md | 2 +- packages/core-data/src/selectors.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core-data/README.md b/packages/core-data/README.md index 7cd7bbdf3849a5..18a1834c6b0985 100644 --- a/packages/core-data/README.md +++ b/packages/core-data/README.md @@ -376,7 +376,7 @@ _Parameters_ _Returns_ -- `boolean`: Whether the entities are loaded +- `Array`: Array of entities with config matching kind. # **getEntity** diff --git a/packages/core-data/src/selectors.js b/packages/core-data/src/selectors.js index 6e94ddcaab6c8c..80acd04cc15b12 100644 --- a/packages/core-data/src/selectors.js +++ b/packages/core-data/src/selectors.js @@ -110,7 +110,7 @@ export const getUserQueryResults = createSelector( * @param {Object} state Data state. * @param {string} kind Entity kind. * - * @return {boolean} Whether the entities are loaded + * @return {Array} Array of entities with config matching kind. */ export function getEntitiesByKind( state, kind ) { return filter( state.entities.config, { kind } );