/*
 * @Author: codingfly
 * @Description:
 * @Date: 2022-02-21 08:08:15
 * @LastEditTime: 2022-05-25 14:17:18
 * @FilePath: \remaxui\src\show-toast\one\index.ali.tsx
 */
import { showToast } from 'remax/ali';
export default (function(_ref) {
  var title = _ref.title,
    icon = _ref.icon,
    _ref$duration = _ref.duration,
    duration = _ref$duration === void 0 ? 3000 : _ref$duration;
  return new Promise(function(resolve) {
    showToast({
      type: icon,
      content: title,
      duration: duration,
      success: function success() {
        setTimeout(function() {
          resolve('');
        }, duration);
      },
    });
  });
});
