"use strict";

exports.__esModule = true;
exports.initEvent = initEvent;

var _http = require("./http");

// 检查request有没有加载
function initEvent() {
  if (window.ks && window.ks.request) {
    dispatchEvent();
  } else {
    setTimeout(function () {
      if (window.ks && window.ks.request) {
        _dispatchEvent();
      } else {
        initEvent();
      }
    }, 300);
  }
}

function _dispatchEvent() {
  window.dispatchEvent(new CustomEvent('__ks_ready__', {
    detail: {
      http: _http.http
    }
  }));
}