import ViewUI from "view-design";
let msgInstance = null;
let resetMessage = {
  destroy: ViewUI.Message.destroy
};
["error", "success", "info", "warning", "loading", "config"].forEach((type) => {
  resetMessage[type] = (options) => {
    if (msgInstance) {
      ViewUI.Message.destroy();
    }
    msgInstance = ViewUI.Message[type](options);
  };
});
export const message = resetMessage;
