Skip to content

justin-oh/ohjs-script-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Javascript module that exports a function to load external JS on the fly. A script is not included more than once so multiple places on the page can attempt to load the same script.

Basic usage:

import scriptLoader from 'ohjs-script-loader';

await scriptLoader(
    'https://maps.googleapis.com/maps/api/js',
    () => {
        return window.hasOwnProperty('google')
            && window.google.hasOwnProperty('maps');
    }
);

console.log('Google Maps API is ready!');

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published