Current Behavior
Passing undefined to entityIds prop of the EntityList helper component returns all entities for that type. This behavior resulted in app crashing in glorious fashion when every component was passed 1500 entities to render.
Input Code
REPL or Repo link if applicable:
<EntityList entityIds={undefined} entityType="worksheetQuestion">
{questionList => {
// !!!
// !!! questionList is array of every entity detail in redux store state `entities.worksheetQuestion`
// !!!
}}
</<EntityList>
Expected behavior/code
It should return 0 results and possibly warn in dev console?
Environment
uptrend-redux-modules version: [e.g. v0.21.0]
node version: [e.g. Node v9.11.1]
yarn (or npm) version: [e.g. Yarn v1.6.0]
Possible Solution
Update the EntityList component to short circuit if entityIds is not pass array.
After review the current implementation returns all entities when entittIds is not set (undefined). This behavior should be removed and a boolean prop flag returnAllEntities added to return all entities.
Bug Report
Current Behavior Passing
undefined
toentityIds
prop of the EntityList helper component returns all entities for that type. This behavior resulted in app crashing in glorious fashion when every component was passed 1500 entities to render.Input Code
Expected behavior/code It should return 0 results and possibly warn in dev console?
Environment
uptrend-redux-modules
version: [e.g. v0.21.0]node
version: [e.g. Node v9.11.1]yarn
(ornpm
) version: [e.g. Yarn v1.6.0]Possible Solution
Update the EntityList component to short circuit if
entityIds
is not pass array.