Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@enact/core

Package Overview
Dependencies
Maintainers
1
Versions
218
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@enact/core - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

6

CHANGELOG.md

@@ -5,2 +5,8 @@ # Change Log

## [2.2.2] - 2018-10-15
### Fixed
- `core/util.Job` to cancel existing scheduled `idle()` jobs before scheduling another
## [2.2.1] - 2018-10-09

@@ -7,0 +13,0 @@

2

package.json
{
"name": "@enact/core",
"version": "2.2.1",
"version": "2.2.2",
"description": "Enact is an open source JavaScript framework containing everything you need to create a fast, scalable mobile or web application.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -187,14 +187,14 @@ "use strict";

if (typeof window !== 'undefined') {
if (window.requestIdleCallback) {
_this.type = 'idle';
_this.id = window.requestIdleCallback(function () {
return _this.run(args);
}, {
timeout: timeout
});
} else {
// If requestIdleCallback is not supported just run the function immediately
_this.fn.apply(_this, args);
}
if (typeof window !== 'undefined' && window.requestIdleCallback) {
_this.stop();
_this.type = 'idle';
_this.id = window.requestIdleCallback(function () {
return _this.run(args);
}, {
timeout: timeout
});
} else {
// since we can't request an idle callback, just pass to startAfter()
_this.startAfter.apply(_this, [timeout].concat(args));
}

@@ -201,0 +201,0 @@ }

@@ -82,2 +82,18 @@ "use strict";

describe('#idle', function () {
// polyfill for PhantomJS to verify expected idle behavior as much as possible
var windowRequest = window.requestIdleCallback;
var windowCancel = window.cancelIdleCallback;
before(function () {
window.requestIdleCallback = windowRequest || function (fn) {
return setTimeout(fn, 0);
};
window.cancelIdleCallback = windowCancel || function (id) {
clearTimeout(id);
};
});
after(function () {
window.requestIdleCallback = windowRequest;
window.cancelIdleCallback = windowCancel;
});
it('should start job', function (done) {

@@ -101,3 +117,16 @@ var j = new _Job.default(done, 10);

});
it('should clear an existing job id before starting job', function (done) {
var fn = function fn(arg) {
if (arg === 'first') {
done(new Error('First job ran'));
} else {
done();
}
};
var j = new _Job.default(fn);
j.idle('first');
j.idle('second');
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc