UNPKG

1.13 kBJavaScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * strict
8 * @format
9 */
10'use strict';
11
12var GraphQLMultiReporter =
13/*#__PURE__*/
14function () {
15 function GraphQLMultiReporter() {
16 for (var _len = arguments.length, reporters = new Array(_len), _key = 0; _key < _len; _key++) {
17 reporters[_key] = arguments[_key];
18 }
19
20 this._reporters = reporters;
21 }
22
23 var _proto = GraphQLMultiReporter.prototype;
24
25 _proto.reportMessage = function reportMessage(message) {
26 this._reporters.forEach(function (reporter) {
27 reporter.reportMessage(message);
28 });
29 };
30
31 _proto.reportTime = function reportTime(name, ms) {
32 this._reporters.forEach(function (reporter) {
33 reporter.reportTime(name, ms);
34 });
35 };
36
37 _proto.reportError = function reportError(caughtLocation, error) {
38 this._reporters.forEach(function (reporter) {
39 reporter.reportError(caughtLocation, error);
40 });
41 };
42
43 return GraphQLMultiReporter;
44}();
45
46module.exports = GraphQLMultiReporter;
\No newline at end of file