How to use the @parcel/events.ValueEmitter function in @parcel/events

To help you get started, we’ve selected a few @parcel/events examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github parcel-bundler / parcel / packages / reporters / cli / src / CLIReporter.js View on Github external
// @flow strict-local

import type {ReporterEvent} from '@parcel/types';

import {render} from 'ink';
import {Reporter} from '@parcel/plugin';
import React from 'react';
import {ValueEmitter} from '@parcel/events';

import UI from './UI';

let rendered = false;
let events = new ValueEmitter();

export default new Reporter({
  report({event, options}) {
    if (!rendered) {
      render();
      rendered = true;
    }

    events.emit(event);
  },
});

@parcel/events

MIT
Latest version published 6 days ago

Package Health Score

89 / 100
Full package analysis

Popular @parcel/events functions

Similar packages