From 579882a9c0fbf68a421ac1f659ad8ad57df3af50 Mon Sep 17 00:00:00 2001 From: tunnckoCore Date: Mon, 25 Apr 2016 19:59:31 +0300 Subject: [PATCH] switch to extend `app-base` directly not `compose-emitter` --- index.js | 14 +++++++------- package.json | 3 ++- utils.js | 3 ++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 43d7c84..5dcd0e4 100644 --- a/index.js +++ b/index.js @@ -8,7 +8,7 @@ 'use strict' var utils = require('./utils') -var AppBase = require('compose-emitter').ComposeEmitter +var AppBase = require('app-base').AppBase /** * > Initialize `AsyncSimpleIterator` with `options`. @@ -54,11 +54,11 @@ function AsyncSimpleIterator (options) { return new AsyncSimpleIterator(options) } this.defaultOptions(options) - AppBase.call(this, this.options) - this.on = this.compose('on') - this.off = this.compose('off') - this.once = this.compose('once') - this.emit = this.compose('emit') + AppBase.call(this) + this.on = utils.emitter.compose.call(this, 'on', this.options) + this.off = utils.emitter.compose.call(this, 'off', this.options) + this.once = utils.emitter.compose.call(this, 'once', this.options) + this.emit = utils.emitter.compose.call(this, 'emit', this.options) } AppBase.extend(AsyncSimpleIterator) @@ -79,7 +79,7 @@ AppBase.define(AsyncSimpleIterator.prototype, 'defaultOptions', function default opts = opts ? utils.extend(options, opts) : opts opts = utils.extend({ - emitter: new utils.Emitter(), + emitter: new utils.EventEmitter(), settle: false }, options, opts) diff --git a/package.json b/package.json index d837d51..30dd156 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "test": "standard && node test.js" }, "dependencies": { - "compose-emitter": "^1.1.0", + "app-base": "github:tunnckocore/app-base", + "compose-emitter": "^1.2.0", "eventemitter3": "^1.2.0", "extend-shallow": "^2.0.1", "is-typeof-error": "^1.1.0", diff --git a/utils.js b/utils.js index 3fa3343..1fcf271 100644 --- a/utils.js +++ b/utils.js @@ -24,7 +24,8 @@ require = utils // eslint-disable-line no-undef, no-native-reassign * Lazily required module dependencies */ -require('eventemitter3', 'Emitter') +require('compose-emitter', 'emitter') +require('eventemitter3', 'EventEmitter') require('extend-shallow', 'extend') require('is-typeof-error', 'isError') require('sliced', 'slice')