Commit b64ea617 authored by Grandschtroumpf's avatar Grandschtroumpf

Improve the way to add entity in store

parent bf669ec8
...@@ -135,7 +135,8 @@ export class EntityStore extends Store { ...@@ -135,7 +135,8 @@ export class EntityStore extends Store {
* Add a new entity to the state * Add a new entity to the state
* @param {Object} entity * @param {Object} entity
*/ */
add (id, entity) { add (entity) {
const id = entity[this.keyId]
this.state.entities[id] = entity this.state.entities[id] = entity
this.state.ids.push(id) this.state.ids.push(id)
this.event.emit('add', entity) this.event.emit('add', entity)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment