import nativeEventer from '../../common/nativeEventer';
import messager from '../../common/messager';
import TOPICS from '../../const/topic';

const { DEV_MESSAGE } = TOPICS;
const TOPIC = [
  `${DEV_MESSAGE}.dev-sys`,
  'subscribeSubmit',
  'giftSubmit',
  'barrageSubmit',
  'downloadProgress'
];

const eventer = new nativeEventer({ topic: TOPIC });

export default {
  on(event, callback) {
    return eventer.on(event, callback);
  },

  off(event, callback) {
    return eventer.off(event, callback);
  },

  showToast(msg) {
    return messager.dispatch('showToast', { msg });
  }
}










