Improve the way to add entity in store

pull/1/head
Grandschtroumpf 6 years ago
parent bf669ec817
commit b64ea61761
  1. 3
      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)

Loading…
Cancel
Save