Skip to content

Commit

Permalink
refactor(reporter): update lib/reporter/multi.js to ES6 (#3018)
Browse files Browse the repository at this point in the history
  • Loading branch information
lusarz authored and johnjbarton committed May 25, 2018
1 parent 8e54248 commit c1526a1
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions lib/reporters/multi.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
var helper = require('../helper')
'use strict'

var MultiReporter = function (reporters) {
this.addAdapter = function (adapter) {
reporters.forEach(function (reporter) {
reporter.adapters.push(adapter)
})
const helper = require('../helper')

class MultiReporter {
constructor (reporters) {
this._reporters = reporters
}

addAdapter (adapter) {
this._reporters.forEach((reporter) => reporter.adapters.push(adapter))
}

this.removeAdapter = function (adapter) {
reporters.forEach(function (reporter) {
helper.arrayRemove(reporter.adapters, adapter)
})
removeAdapter (adapter) {
this._reporters.forEach((reporter) => helper.arrayRemove(reporter.adapters, adapter))
}
}

// PUBLISH
module.exports = MultiReporter

0 comments on commit c1526a1

Please sign in to comment.