#bufferChanges() → #bufferEvents().

This commit is contained in:
Julien Fontanet 2015-04-08 11:51:18 +02:00
parent 0303558ae1
commit 45441653f6

View File

@ -26,7 +26,7 @@ export default class Collection extends EventEmitter {
this._size = 0 this._size = 0
} }
bufferChanges () { bufferEvents () {
++this._buffering ++this._buffering
let called = false let called = false
@ -64,7 +64,9 @@ export default class Collection extends EventEmitter {
_touch (action, key) { _touch (action, key) {
if (this._buffering === 0) { if (this._buffering === 0) {
process.nextTick(this.bufferChanges()) const flush = this.bufferEvents()
process.nextTick(flush)
} }
switch (action) { switch (action) {
case 'add': case 'add':