Skip to content

Commit

Permalink
Fixes return type for getEntitiesByKind (#30639)
Browse files Browse the repository at this point in the history
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<Object> not a boolean.

Closes #29260
  • Loading branch information
mkaz committed Apr 9, 2021
1 parent b6272d9 commit 2aefc5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ _Parameters_

_Returns_

- `boolean`: Whether the entities are loaded
- `Array<Object>`: Array of entities with config matching kind.

<a name="getEntity" href="#getEntity">#</a> **getEntity**

Expand Down
2 changes: 1 addition & 1 deletion packages/core-data/src/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<Object>} Array of entities with config matching kind.
*/
export function getEntitiesByKind( state, kind ) {
return filter( state.entities.config, { kind } );
Expand Down

0 comments on commit 2aefc5b

Please sign in to comment.