import { addBtnLoader } from './service/append';
import { onChangeTab, onLocationChange } from '@content/service/util';
import { listenerFetch } from '@content/service/event';

export function main(ctx) {
  document.addEventListener('readystatechange', () => {
    ctx.setTimeout(() => {
      addBtnLoader();
    }, 2000);
  });

  onChangeTab(() => {
    ctx.setTimeout(() => {
      addBtnLoader();
    }, 1000);
  });

  onLocationChange(() => {
    ctx.setTimeout(() => {
      addBtnLoader();
    }, 500);
  });

  ctx.setTimeout(() => {
    listenerFetch();
  }, 500);
}
