rx-script-loader
RxScriptLoader is a fast, lightweight and flexible script that speeds up your web application by loading js files dynamiclly. It's written in TypeScript and uses RxJS library. Can be used as ES2015 module import or can be loaded with script tag.
Installation
npm install rx-script-loader
Usage
ES2015 module import:
;// ...const scripts = src:'https://cdnjs.cloudflare.com/ajax/libs/ramda/0.26.1/ramda.js' defer: true async: false src:'https://cdnjs.cloudflare.com/ajax/libs/rxjs/6.4.0/rxjs.umd.min.js'; const libScriptsLoader = scripts;libScriptsLoader;libScriptsLoader;
The consumer also can use the library by loading it via a script tag:
...
Script Model
src - string, required
defer - true/false, optional
async - true/false, optional
ASYNC AND DEFER
Both async and defer are script attributes:
if you provide both, async takes precedence on modern browsers. Old browsers that support defer but do not support async will fallback to defer.