import mitt from 'mitt';
const EVENTS = {
  CLOSE: 'close'
};
const emitter = mitt();
class DropdownEvents {
  closeAllDropdowns() {
    emitter.emit(EVENTS.CLOSE);
  }
  onCloseAllDropdowns(callback) {
    emitter.on(EVENTS.CLOSE, callback);
    return () => {
      emitter.off(EVENTS.CLOSE, callback);
    };
  }
}
const dropdownEvents = new DropdownEvents();
export { dropdownEvents as DropdownEvents };