From b64ea61761dd2c667b4a5b851de736cd48f2b957 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Thu, 14 Mar 2019 13:18:01 +0100 Subject: [PATCH] Improve the way to add entity in store --- src/lib/store.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/store.js b/src/lib/store.js index 49c4a4e68a..e9b699d516 100644 --- a/src/lib/store.js +++ b/src/lib/store.js @@ -135,7 +135,8 @@ export class EntityStore extends Store { * Add a new entity to the state * @param {Object} entity */ - add (id, entity) { + add (entity) { + const id = entity[this.keyId] this.state.entities[id] = entity this.state.ids.push(id) this.event.emit('add', entity)