import nativeEventer from '../../common/nativeEventer';
import messager from '../../common/messager';

const TOPIC_NAME = 'context.emit';
const eventer = new nativeEventer({ topic: TOPIC_NAME });

export default {

  on(topic, callback) {
    return eventer.on(topic, callback);
  },

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

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

}