How to use the ev-emitter function in ev-emitter

To help you get started, we’ve selected a few ev-emitter 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 CMSgov / design-system / packages / core / src / components / ChoiceList / Choice.jsx View on Github external
import EvEmitter from 'ev-emitter';
import FormLabel from '../FormLabel/FormLabel';
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import uniqueId from 'lodash.uniqueid';

/** Used to emit events to all Choice components */
const dsChoiceEmitter = new EvEmitter();

export class Choice extends React.PureComponent {
  constructor(props) {
    super(props);

    if (props['inputPlacement'] === 'right') {
      console.error(
        `[Deprecated]: Please remove the React property 'inputPlacement' for the  component. It is no longer supported and will be removed in a future release.`
      );
    }

    this.input = null;
    this.handleChange = this.handleChange.bind(this);
    this.id = this.props.id || uniqueId(`${this.props.type}_${this.props.name}_`);

    if (typeof this.props.checked === 'undefined') {

ev-emitter

lil' event emitter

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis

Popular ev-emitter functions