/* eslint-disable no-undef */

/**
 * H5 加载 Taf
 */
module.exports = function () {
  const wsChannelSrc = 'https://hyext.msstatic.com/taf/wsChannel.min.js';
  return new Promise((resolve, reject) => {
    if (window.HUYA && window.HUYA.UserId) return resolve(window);
    require('scriptjs')(wsChannelSrc, () => resolve(window));
  });
};