import { IConfig } from "@cfg/index.d";

export const loadConfig = (url: string): Promise<IConfig<any>> =>
  new Promise((resolve, reject) => {
    fetch(url)
      .then(res => res.json())
      .then(parsedConfig => {
        resolve(parsedConfig);
      })
      .catch(reject);
  });

import { IConfig } from "@cfg/index.d";

export const loadConfig = (url: string): Promise<IConfig<any>> =>
  new Promise((resolve, reject) => {
    fetch(url)
      .then(res => res.json())
      .catch(reject)
      .then(parsedConfig => {
        resolve(parsedConfig);
      });
  });

Fix runtime config loader example promise rejection being called too late
Fix runtime config loader example promise rejection being called too late
