1.0.2
- Improved:
method
timing now returns.then
ready callback when using API module:custom_load_script().then(/*...*/)
- Added
$async.time
method.
$async.time
enables to make use of the timing module for any purpose, for example for script startup-time optimization or to execute a script when an element scrolls into view or matches a Media Query.
$async.time
requires both the API and timing module.
$async.time(
{
"type": "requestIdleCallback",
"timeout": 3000
},
function() {
// big script
},
["big-script"]
);
With JSON compression it would result in the following:
$async.time({"2":53,"57":3000},function(){});
When using debug sources, the browser console will provide Performance API details.