4.0.3 • Published 2 months ago
@ima/plugin-script-loader v4.0.3
@ima/plugin-script-loader
This is the plugin for loading 3rd party scripts for the IMA.js application. You can visit our site https://imajs.io.
Installation
npm install @ima/plugin-script-loader --save
// /app/build.js
var vendors = {
common: [
'@ima/plugin-script-loader'
]
};
/*
Now is script loader plugin available as:
import { ScriptLoaderPlugin, Events, defaultDependencies } from '@ima/plugin-script-loader';
*/
Usage
import Dispatcher from 'ima/event/Dispatcher';
import { ScriptLoaderPlugin, Events as ScriptLoaderEvents } from '@ima/plugin-script-loader';
oc
.get(ScriptLoaderPlugin)
.load('//www.example.com/script.js')
.then((result) => {
console.log('Script is loaded.', result.url);
})
.catch((error) => {
console.log('Script failed to load.', error);
});
oc
.get(Dispatcher)
.listen(ScriptLoaderEvents.LOADED, (result) => {
if (result.error) {
console.log('Script is not loaded.', result.url);
} else {
console.log('Script is loaded.', result.url);
}
});
4.0.3
2 months ago
4.0.2
2 months ago
4.0.1
2 months ago
4.0.0
2 months ago
3.1.3
3 months ago
3.1.1-rc.2
1 year ago
3.1.1-rc.1
1 year ago
3.1.1-rc.4
1 year ago
3.1.1-rc.3
1 year ago
3.1.2
1 year ago
3.1.1
1 year ago
3.1.1-rc.0
1 year ago
3.1.0
1 year ago
3.0.1
1 year ago
3.0.0
1 year ago
3.0.0-rc.10
1 year ago
3.0.0-rc.9
2 years ago
3.0.0-rc.8
2 years ago
3.0.0-rc.7
2 years ago
3.0.0-rc.6
2 years ago
3.0.0-rc.5
2 years ago
3.0.0-rc.4
2 years ago
3.0.0-rc.3
2 years ago
3.0.0-rc.2
2 years ago
3.0.0-rc.1
2 years ago
3.0.0-rc.0
2 years ago
2.2.1
2 years ago
2.2.2
2 years ago
2.2.0
2 years ago
2.1.0
3 years ago
2.0.1
4 years ago
2.0.0
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago