From f30509cf99f24b43ea1f9d3af219a373825531af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Livora?= Date: Sun, 4 Feb 2018 14:32:14 +0100 Subject: [PATCH] fix(Entity): Do not store null entity keys --- modules/entity/src/unsorted_state_adapter.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/entity/src/unsorted_state_adapter.ts b/modules/entity/src/unsorted_state_adapter.ts index dcf1d53214..72f12585b3 100644 --- a/modules/entity/src/unsorted_state_adapter.ts +++ b/modules/entity/src/unsorted_state_adapter.ts @@ -25,9 +25,8 @@ export function createUnsortedStateAdapter(selectId: IdSelector): any { function addManyMutably(entities: any[], state: any): DidMutate { let didMutate = false; - for (let index in entities) { - didMutate = - addOneMutably(entities[index], state) !== DidMutate.None || didMutate; + for (const entity of entities) { + didMutate = addOneMutably(entity, state) !== DidMutate.None || didMutate; } return didMutate ? DidMutate.Both : DidMutate.None;