How to use the mitt.default function in mitt

To help you get started, we’ve selected a few mitt 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 suchipi / react-send / src / index.js View on Github external
const Component = require("react").Component;
let mitt = require("mitt");
if (mitt.default) {
  mitt = mitt.default;
}

module.exports = function send(name = "Send") {
  let emitter = mitt();

  class Input extends Component {
    static displayName = `${name}.Input`;

    componentDidMount() {
      emitter.emit("update", this.props.children);
    }

    componentDidUpdate() {
      emitter.emit("update", this.props.children);
    }
github suchipi / react-send / src / index.js View on Github external
const Component = require("react").Component;
let mitt = require("mitt");
if (mitt.default) {
  mitt = mitt.default;
}

module.exports = function send(name = "Send") {
  let emitter = mitt();

  class Input extends Component {
    static displayName = `${name}.Input`;

    componentDidMount() {
      emitter.emit("update", this.props.children);
    }

    componentDidUpdate() {
      emitter.emit("update", this.props.children);
    }
github QianmiOpen / plume2 / dist / msg.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const mitt = require("mitt");
exports.default = new (mitt.default || mitt)();

mitt

Tiny 200b functional Event Emitter / pubsub.

MIT
Latest version published 1 year ago

Package Health Score

73 / 100
Full package analysis

Popular mitt functions