react-async-script-loader icon indicating copy to clipboard operation
react-async-script-loader copied to clipboard

Promisify the method startLoadingScripts

Open lkazberova opened this issue 6 years ago • 0 comments

It's cool to use this method alone, as part of chain or with react-loadable, like that

Loadable.Map({
  loader: {
    Map: () => import('./Map'),
    GoogleMapApi: () => startLoadingScripts('https://maps.googleapis.com/maps/api'),
  },
  render(loaded, props) {
    let Map = loaded.Map.default;
    let GoogleMapApi = GoogleMapApi;
    return <Map {...props}/>;
  },
});

lkazberova avatar Aug 25 '18 14:08 lkazberova