Download next.js/packages/next/src/trace/report/index.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 684 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/trace/report/index.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/trace/report/index.ts
-
curl -L -o index.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/trace/report/index.ts
684 Bytes
| import type { TraceEvent } from '../types' | |
| import reportToTelemetry from './to-telemetry' | |
| import reportToJson from './to-json' | |
| import type { Reporter } from './types' | |
| class MultiReporter implements Reporter { | |
| private reporters: Reporter[] = [] | |
| constructor(reporters: Reporter[]) { | |
| this.reporters = reporters | |
| } | |
| async flushAll(opts?: { end: boolean }) { | |
| await Promise.all(this.reporters.map((reporter) => reporter.flushAll(opts))) | |
| } | |
| report(event: TraceEvent) { | |
| this.reporters.forEach((reporter) => reporter.report(event)) | |
| } | |
| } | |
| // JSON is always reported to allow for diagnostics | |
| export const reporter = new MultiReporter([reportToJson, reportToTelemetry]) | |