function documentReady(callback) {
  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', function() {
      callback();
    });
  } else {
    callback();
  }
}

export default documentReady;
