Skip to content

bragle/Unbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Unbox

A super simple JavaScript loader

How to use:

Create an instance of Unbox

const Unbox = new Unbox;

Load a script

Unbox.require('/js/quill.js', _ => {

  if (Quill instanceof Object) {

    quill = new Quill(document.getElementById('quill');

  }

});

You can use require multiple times with the same source, and it'll resolve the callbacks when the script is loaded

Load one or more scripts when the browser is idle

Unbox.lazyRequire('/js/quill.js');
Unbox.lazyRequire([

  '/js/monaco/min/vs/loader.js',
  '/js/quill.js'

]);

Check if one or more script is loaded

Unbox.loaded('/js/quill.js');
Unbox.loaded([

  '/js/monaco/min/vs/loader.js',
  '/js/quill.js'

]);

About

A super simple JavaScript loader

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published