Skip to content

Commit

Permalink
Merge pull request masylum#7 from nickryall/master
Browse files Browse the repository at this point in the history
Ensure models remains an observable array after add
  • Loading branch information
masylum authored Mar 25, 2017
2 parents 1c23c4c + 9419871 commit 4d79f89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default class Collection<T: Model> {
*/
@action add (data: Array<{ [key: string]: any }>): Array<T> {
const models = data.map(d => this.build(d))
this.models = this.models.concat(models)
this.models.push(...models)
return models
}

Expand Down

0 comments on commit 4d79f89

Please sign in to comment.