lazyLoader
Updated pdexter 2022-10-22
Object; Loads a third party library in order to use it within a ruleset.
This has the advantage that loaded libraries are still available when the app is offline (to be confirmed).
(client-side object)
Syntax
ft3.lazyLoader.load({...
name : name-of-library,
files : [
url1,
url2, etc
]
})
.then(function() {
// initialise library object
})
Part | Description |
---|---|
name-of-library | the name to use to refer to the library (within this function only) |
url1, url2, etc | url addresses of the files needed to load |
Example
ft3.lazyLoader.load({name: 'swal', files: [
"https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.6.2/sweetalert2.min.js",
"https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.6.2/sweetalert2.min.css"
]})
.then(function() {
// Assign fetched object to our own ft3.
ft3.swal = window.swal;
});