2.1.0-beta.48 • Published 1 year ago

@emoneyadvisor/emui-publish-event v2.1.0-beta.48

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

emui-publish-event

A small utility library to dispatch custom events scoped to tags.

Usage

import publishEvent from '@emoneyadvisor/emui-publish-event';

class SomeComponent {
  publishEvent;

  constructor() {
    super();

    this.publishEvent = publishEvent.bind(this);
  }

  foo() {
    // Dispatch event emui-some-component-custom-event with detail { foo: 'bar' }
    this.publishEvent('custom-event', { foo: 'bar' });
  }
}