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

framesync

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

framesync - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

2

framesync.global.min.js

@@ -1,1 +0,1 @@

!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}var i=n(1),u=r(i);window.framesync=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.Process=e.currentTime=void 0;var i=n(2),u=r(i),o=n(3),s=r(o);e.currentTime=u["default"],e.Process=s["default"]},function(t,e,n){"use strict";e.__esModule=!0;var r="undefined"!=typeof performance&&performance.now;e["default"]=function(){return r?performance.now():(new Date).getTime()}},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var u=n(4),o=r(u),s=function(){function t(e,n){i(this,t);for(var r in e)e.hasOwnProperty(r)&&(this[r]=e[r]);this.isLazy=n||!1,this.id=o.getProcessId(),this.isActive=!1}return t.prototype.start=function(){return this.isActive=!0,o.activate(this.id,this),this},t.prototype.stop=function(){return this.isActive=!1,o.deactivate(this.id),this},t.prototype.once=function(){var t=this;return this.cleanup=function(){t.stop(),t.cleanup=void 0},this.start(),this},t}();e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=t?1:-1;M+=n,e||(x+=n)}function u(){for(var t=P.length;t--;){var e=P[t],n=O.indexOf(e);n>-1&&(O.splice(n,1),i(!1,g[e].isLazy),delete g[e])}P=[]}function o(t,e){var n={},r="",i=!1,o=void 0,s=void 0;u();for(var a=M,f=0;w>f;f++){n=m[f],r=n.step,i=n.isRender?!0:!1;for(var c=0;a>c;c++)o=g[O[c]],o&&o[r]&&(s=o[r].call(o,o,t,e)),r===_&&(o._render=o[_]&&s===!1?!1:!0)}return u(),x?!0:!1}function s(){h["default"](function(t){R&&s(),p["default"].update(t),R=o(t,p["default"].getElapsed())})}function a(){R||(p["default"].start(),R=!0,s())}function f(){return y++}function c(t,e){var n=P.indexOf(t),r=n>-1,u=O.indexOf(t)>-1;r&&P.splice(n,1),u||(O.push(t),g[t]=e,i(!0,e.isLazy),a())}function d(t){-1===P.indexOf(t)&&P.push(t)}e.__esModule=!0,e.getProcessId=f,e.activate=c,e.deactivate=d;var l=n(5),p=r(l),v=n(6),h=r(v),_="willRender",m=[{step:"frameStart"},{step:"update"},{step:_},{step:"preRender",isRender:!0},{step:"render",isRender:!0},{step:"postRender",isRender:!0},{step:"frameEnd"},{step:"cleanup"}],w=m.length,y=0,M=0,x=0,O=[],g={},P=[],R=!1},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var i=n(2),u=r(i),o=33,s=0,a=16.7;e["default"]={update:function(t){var e=s;s=t,a=Math.min(s-e,o)},start:function(){return s=u["default"]()},getElapsed:function(){return a}}},function(t,e,n){"use strict";e.__esModule=!0;var r="undefined"!=typeof window&&window.requestAnimationFrame?!0:!1,i=void 0;r?i=window.requestAnimationFrame:!function(){var t=0;i=function(e){var n=(new Date).getTime(),r=Math.max(0,16-(n-t));t=n+r,setTimeout(function(){return e(t)},r)}}(),e["default"]=i}]);
!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}var i=n(1),o=r(i);window.framesync=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.setDilation=e.setSteps=e.Process=void 0;var i=n(2),o=r(i),s=n(3),u=n(4);e.Process=o["default"],e.setSteps=s.setSteps,e.setDilation=u.setDilation},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var o=n(3),s=r(o),u=function(){function t(e,n){i(this,t);for(var r in e)e.hasOwnProperty(r)&&(this[r]=e[r]);this.isLazy=n||!1,this.id=s.getProcessId(),this.isActive=!1}return t.prototype.start=function(){return this.isActive=!0,s.activate(this.id,this),this},t.prototype.stop=function(){return this.isActive=!1,s.deactivate(this.id),this},t.prototype.once=function(){var t=this;return this.cleanup=function(){t.stop(),t.cleanup=void 0},this.start(),this},t}();e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=t?1:-1;M+=n,e||(x+=n)}function o(){for(var t=g.length;t--;){var e=g[t],n=O.indexOf(e);n>-1&&(O.splice(n,1),i(!1,R[e].isLazy),delete R[e])}g=[]}function s(t,e){var n={},r="",i=!1,s=void 0,u=void 0;o();for(var a=M,c=0;m>c;c++){n=w[c],r=n.step,i=n.isRender?!0:!1;for(var f=0;a>f;f++)s=R[O[f]],s&&s[r]&&(u=s[r].call(s,s,t,e)),n.decideRender&&(s._render=s[r]&&u===!1?!1:!0)}return o(),x?!0:!1}function u(){_["default"](function(t){P&&u(),v["default"].update(t),P=s(t,v["default"].getElapsed())})}function a(){P||(v["default"].start(),P=!0,u())}function c(){return y++}function f(t,e){var n=g.indexOf(t),r=n>-1,o=O.indexOf(t)>-1;r&&g.splice(n,1),o||(O.push(t),R[t]=e,i(!0,e.isLazy),a())}function d(t){-1===g.indexOf(t)&&g.push(t)}function l(t){w=t}e.__esModule=!0,e.getProcessId=c,e.activate=f,e.deactivate=d,e.setSteps=l;var p=n(4),v=r(p),h=n(5),_=r(h),w=[{step:"frameStart"},{step:"update"},{step:"willRender",decideRender:!0},{step:"preRender",isRender:!0},{step:"render",isRender:!0},{step:"postRender",isRender:!0},{step:"frameEnd"},{step:"cleanup"}],m=w.length,y=0,M=0,x=0,O=[],R={},g=[],P=!1},function(t,e,n){"use strict";function r(t){f=t}e.__esModule=!0,e.setDilation=r;var i="undefined"!=typeof performance&&performance.now,o=function(){return i?performance.now():(new Date).getTime()},s=33,u=0,a=0,c=16.7,f=1,d=0;e["default"]={update:function(t){0===u&&(a=u=t);var e=a,n=t-d,r=Math.min(n-e,s);c=r*f,a+=c,d+=r-c},start:function(){return a=o()},getElapsed:function(){return c}}},function(t,e,n){"use strict";e.__esModule=!0;var r="undefined"!=typeof window&&window.requestAnimationFrame?!0:!1,i=void 0;r?i=window.requestAnimationFrame:!function(){var t=0;i=function(e){var n=(new Date).getTime(),r=Math.max(0,16-(n-t));t=n+r,setTimeout(function(){return e(t)},r)}}(),e["default"]=i}]);
'use strict';
exports.__esModule = true;
exports.Process = exports.currentTime = undefined;
exports.setDilation = exports.setSteps = exports.Process = undefined;
var _currentTime = require('./inc/current-time');
var _currentTime2 = _interopRequireDefault(_currentTime);
var _Process = require('./Process');

@@ -14,6 +10,11 @@

var _loop = require('./loop');
var _timer = require('./inc/timer');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.currentTime = _currentTime2.default;
exports.Process = _Process2.default;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9mcmFtZXN5bmMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7O1FBR1MsV0FBVztRQUFFLE9BQU8iLCJmaWxlIjoiZnJhbWVzeW5jLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGN1cnJlbnRUaW1lIGZyb20gJy4vaW5jL2N1cnJlbnQtdGltZSc7XG5pbXBvcnQgUHJvY2VzcyBmcm9tICcuL1Byb2Nlc3MnO1xuXG5leHBvcnQgeyBjdXJyZW50VGltZSwgUHJvY2VzcyB9OyJdfQ==
exports.setSteps = _loop.setSteps;
exports.setDilation = _timer.setDilation;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9mcmFtZXN5bmMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7O1FBSVMsT0FBTztRQUFFLFFBQVEsU0FIakIsUUFBUTtRQUdXLFdBQVcsVUFGOUIsV0FBVyIsImZpbGUiOiJmcmFtZXN5bmMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUHJvY2VzcyBmcm9tICcuL1Byb2Nlc3MnO1xuaW1wb3J0IHsgc2V0U3RlcHMgfSBmcm9tICcuL2xvb3AnO1xuaW1wb3J0IHsgc2V0RGlsYXRpb24gfSBmcm9tICcuL2luYy90aW1lcidcblxuZXhwb3J0IHsgUHJvY2Vzcywgc2V0U3RlcHMsIHNldERpbGF0aW9uIH07Il19
'use strict';
exports.__esModule = true;
exports.setDilation = setDilation;
var hasPerformanceNow = typeof performance !== 'undefined' && performance.now;
var currentTime = function () {
return hasPerformanceNow ? performance.now() : new Date().getTime();
};
var _currentTime = require('./current-time.js');
var _currentTime2 = _interopRequireDefault(_currentTime);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var MAX_ELAPSED = 33;
var base = 0;
var current = 0;
var elapsed = 16.7;
var dilation = 1;
var lostTime = 0;
exports.default = {
update: function (framestamp) {
if (base === 0) {
current = base = framestamp;
}
var prev = current;
current = framestamp;
elapsed = Math.min(current - prev, MAX_ELAPSED);
var lossAdjusted = framestamp - lostTime;
var nonDilatedElapsed = Math.min(lossAdjusted - prev, MAX_ELAPSED);
elapsed = nonDilatedElapsed * dilation;
current += elapsed;
lostTime += nonDilatedElapsed - elapsed;
},
start: function () {
return current = (0, _currentTime2.default)();
return current = currentTime();
},

@@ -31,2 +40,5 @@

};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbmMvdGltZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUVBLElBQU0sV0FBVyxHQUFHLEVBQUUsQ0FBQzs7QUFFdkIsSUFBSSxPQUFPLEdBQUcsQ0FBQyxDQUFDO0FBQ2hCLElBQUksT0FBTyxHQUFHLElBQUksQ0FBQzs7a0JBRUo7QUFDWCxVQUFNLEVBQUUsVUFBQyxVQUFVLEVBQUs7QUFDcEIsWUFBTSxJQUFJLEdBQUcsT0FBTyxDQUFDO0FBQ3JCLGVBQU8sR0FBRyxVQUFVLENBQUM7QUFDckIsZUFBTyxHQUFHLElBQUksQ0FBQyxHQUFHLENBQUMsT0FBTyxHQUFHLElBQUksRUFBRSxXQUFXLENBQUMsQ0FBQztLQUNuRDs7QUFFRCxTQUFLLEVBQUU7ZUFBTSxPQUFPLEdBQUcsNEJBQWE7S0FBQTs7QUFFcEMsY0FBVSxFQUFFO2VBQU0sT0FBTztLQUFBO0NBQzVCIiwiZmlsZSI6InRpbWVyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGN1cnJlbnRUaW1lIGZyb20gJy4vY3VycmVudC10aW1lLmpzJztcblxuY29uc3QgTUFYX0VMQVBTRUQgPSAzMztcblxubGV0IGN1cnJlbnQgPSAwO1xubGV0IGVsYXBzZWQgPSAxNi43O1xuXG5leHBvcnQgZGVmYXVsdCB7XG4gICAgdXBkYXRlOiAoZnJhbWVzdGFtcCkgPT4ge1xuICAgICAgICBjb25zdCBwcmV2ID0gY3VycmVudDtcbiAgICAgICAgY3VycmVudCA9IGZyYW1lc3RhbXA7XG4gICAgICAgIGVsYXBzZWQgPSBNYXRoLm1pbihjdXJyZW50IC0gcHJldiwgTUFYX0VMQVBTRUQpO1xuICAgIH0sXG5cbiAgICBzdGFydDogKCkgPT4gY3VycmVudCA9IGN1cnJlbnRUaW1lKCksXG5cbiAgICBnZXRFbGFwc2VkOiAoKSA9PiBlbGFwc2VkXG59OyJdfQ==
function setDilation(newDilation) {
dilation = newDilation;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbmMvdGltZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBOEJnQixXQUFXLEdBQVgsV0FBVztBQTlCM0IsSUFBTSxpQkFBaUIsR0FBSSxPQUFPLFdBQVcsS0FBSyxXQUFXLElBQUksV0FBVyxDQUFDLEdBQUcsQUFBQyxDQUFDO0FBQ2xGLElBQU0sV0FBVyxHQUFHO1dBQU0saUJBQWlCLEdBQUcsV0FBVyxDQUFDLEdBQUcsRUFBRSxHQUFHLElBQUksSUFBSSxFQUFFLENBQUMsT0FBTyxFQUFFO0NBQUEsQ0FBQzs7QUFFdkYsSUFBTSxXQUFXLEdBQUcsRUFBRSxDQUFDOztBQUV2QixJQUFJLElBQUksR0FBRyxDQUFDLENBQUM7QUFDYixJQUFJLE9BQU8sR0FBRyxDQUFDLENBQUM7QUFDaEIsSUFBSSxPQUFPLEdBQUcsSUFBSSxDQUFDO0FBQ25CLElBQUksUUFBUSxHQUFHLENBQUMsQ0FBQztBQUNqQixJQUFJLFFBQVEsR0FBRyxDQUFDLENBQUM7O2tCQUVGO0FBQ1gsVUFBTSxFQUFFLFVBQUMsVUFBVSxFQUFLO0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24gPSAxO1xubGV0IGxvc3RUaW1lID0gMDtcblxuZXhwb3J0IGRlZmF1bHQge1xuICAgIHVwZGF0ZTogKGZyYW1lc3RhbXApID0+IHtcbiAgICAgICAgaWYgKGJhc2UgPT09IDApIHtcbiAgICAgICAgICAgIGN1cnJlbnQgPSBiYXNlID0gZnJhbWVzdGFtcDtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IHByZXYgPSBjdXJyZW50O1xuICAgICAgICBjb25zdCBsb3NzQWRqdXN0ZWQgPSBmcmFtZXN0YW1wIC0gbG9zdFRpbWU7XG4gICAgICAgIGNvbnN0IG5vbkRpbGF0ZWRFbGFwc2VkID0gTWF0aC5taW4obG9zc0FkanVzdGVkIC0gcHJldiwgTUFYX0VMQVBTRUQpO1xuICAgICAgICBlbGFwc2VkID0gbm9uRGlsYXRlZEVsYXBzZWQgKiBkaWxhdGlvbjtcbiAgICAgICAgY3VycmVudCArPSBlbGFwc2VkO1xuICAgICAgICBsb3N0VGltZSArPSBub25EaWxhdGVkRWxhcHNlZCAtIGVsYXBzZWQ7XG4gICAgfSxcblxuICAgIHN0YXJ0OiAoKSA9PiBjdXJyZW50ID0gY3VycmVudFRpbWUoKSxcblxuICAgIGdldEVsYXBzZWQ6ICgpID0+IGVsYXBzZWRcbn07XG5cbmV4cG9ydCBmdW5jdGlvbiBzZXREaWxhdGlvbihuZXdEaWxhdGlvbikge1xuICAgIGRpbGF0aW9uID0gbmV3RGlsYXRpb247XG59Il19

@@ -7,2 +7,3 @@ 'use strict';

exports.deactivate = deactivate;
exports.setSteps = setSteps;

@@ -19,4 +20,3 @@ var _timer = require('./inc/timer');

var WILL_RENDER = 'willRender';
var processOrder = [{ step: 'frameStart' }, { step: 'update' }, { step: WILL_RENDER }, { step: 'preRender', isRender: true }, { step: 'render', isRender: true }, { step: 'postRender', isRender: true }, { step: 'frameEnd' }, { step: 'cleanup' }];
var processOrder = [{ step: 'frameStart' }, { step: 'update' }, { step: 'willRender', decideRender: true }, { step: 'preRender', isRender: true }, { step: 'render', isRender: true }, { step: 'postRender', isRender: true }, { step: 'frameEnd' }, { step: 'cleanup' }];
var numProcessSteps = processOrder.length;

@@ -108,4 +108,4 @@

if (methodName === WILL_RENDER) {
process._render = process[WILL_RENDER] && result === false ? false : true;
if (method.decideRender) {
process._render = process[methodName] && result === false ? false : true;
}

@@ -183,2 +183,6 @@ }

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9sb29wLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQTBJZ0IsWUFBWSxHQUFaLFlBQVk7UUFRWixRQUFRLEdBQVIsUUFBUTtRQXVCUixVQUFVLEdBQVYsVUFBVTs7Ozs7Ozs7Ozs7O0FBdEsxQixJQUFNLFdBQVcsR0FBRyxZQUFZLENBQUM7QUFDakMsSUFBTSxZQUFZLEdBQUcsQ0FDakIsRUFBRSxJQUFJLEVBQUUsWUFBWSxFQUFFLEVBQ3RCLEVBQUUsSUFBSSxFQUFFLFFBQVEsRUFBRSxFQUNsQixFQUFFLElBQUksRUFBRSxXQUFXLEVBQUUsRUFDckIsRUFBRSxJQUFJLEVBQUUsV0FBVyxFQUFFLFFBQVEsRUFBRSxJQUFJLEVBQUUsRUFDckMsRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFLFFBQVEsRUFBRSxJQUFJLEVBQUUsRUFDbEMsRUFBRSxJQUFJLEVBQUUsWUFBWSxFQUFFLFFBQVEsRUFBRSxJQUFJLEVBQUUsRUFDdEMsRUFBRSxJQUFJLEVBQUUsVUFBVSxFQUFFLEVBQ3BCLEVBQUUsSUFBSSxFQUFFLFNBQVMsRUFBRSxDQUN0QixDQUFDO0FBQ0YsSUFBTSxlQUFlLEdBQUcsWUFBWSxDQUFDLE1BQU07OztBQUFDLEFBRzVDLElBQUksZ0JBQWdCLEdBQUcsQ0FBQzs7O0FBQUMsQUFHekIsSUFBSSxZQUFZLEdBQ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ZUluZGV4ID4gLTEpO1xuICAgIGNvbnN0IGlzUnVubmluZyA9IChydW5uaW5nSWRzLmluZGV4T2YoaWQpID4gLTEpO1xuXG4gICAgLy8gUmVtb3ZlIGZyb20gZGVhY3RpdmF0ZVF1ZXVlIGlmIHF1ZXVlZFxuICAgIGlmIChpc1F1ZXVlZCkge1xuICAgICAgICBkZWFjdGl2YXRlUXVldWUuc3BsaWNlKHF1ZXVlSW5kZXgsIDEpO1xuICAgIH1cblxuICAgIC8vIEFkZCB0byBydW5uaW5nIHByb2Nlc3NlcyBhcnJheSBpZiBub3QgdGhlcmVcbiAgICBpZiAoIWlzUnVubmluZykge1xuICAgICAgICBydW5uaW5nSWRzLnB1c2goaWQpO1xuICAgICAgICBydW5uaW5nUHJvY2Vzc2VzW2lkXSA9IHByb2Nlc3M7XG5cbiAgICAgICAgdXBkYXRlQ291bnQodHJ1ZSwgcHJvY2Vzcy5pc0xhenkpO1xuICAgICAgICBzdGFydCgpO1xuICAgIH1cbn1cblxuLypcbiAgICBbaW50XTogUHJvY2VzcyBJRCB0byBkZWFjdGl2YXRlXG4qL1xuZXhwb3J0IGZ1bmN0aW9uIGRlYWN0aXZhdGUoaWQpIHtcbiAgICBpZiAoZGVhY3RpdmF0ZVF1ZXVlLmluZGV4T2YoaWQpID09PSAtMSkge1xuICAgICAgICBkZWFjdGl2YXRlUXVldWUucHVzaChpZCk7XG4gICAgfVxufSJdfQ==
function setSteps(newProcessOrder) {
processOrder = newProcessOrder;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9sb29wLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQXlJZ0IsWUFBWSxHQUFaLFlBQVk7UUFRWixRQUFRLEdBQVIsUUFBUTtRQXVCUixVQUFVLEdBQVYsVUFBVTtRQU1WLFFBQVEsR0FBUixRQUFROzs7Ozs7Ozs7Ozs7QUEzS3hCLElBQUksWUFBWSxHQ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ICAgICBydW5uaW5nUHJvY2Vzc2VzW2lkXSA9IHByb2Nlc3M7XG5cbiAgICAgICAgdXBkYXRlQ291bnQodHJ1ZSwgcHJvY2Vzcy5pc0xhenkpO1xuICAgICAgICBzdGFydCgpO1xuICAgIH1cbn1cblxuLypcbiAgICBbaW50XTogUHJvY2VzcyBJRCB0byBkZWFjdGl2YXRlXG4qL1xuZXhwb3J0IGZ1bmN0aW9uIGRlYWN0aXZhdGUoaWQpIHtcbiAgICBpZiAoZGVhY3RpdmF0ZVF1ZXVlLmluZGV4T2YoaWQpID09PSAtMSkge1xuICAgICAgICBkZWFjdGl2YXRlUXVldWUucHVzaChpZCk7XG4gICAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gc2V0U3RlcHMobmV3UHJvY2Vzc09yZGVyKSB7XG4gICAgcHJvY2Vzc09yZGVyID0gbmV3UHJvY2Vzc09yZGVyO1xufSJdfQ==
{
"name": "framesync",
"version": "0.3.0",
"version": "0.4.0",
"description": "A high-performance, frame-synced render loop for any JavaScript environment.",

@@ -5,0 +5,0 @@ "author": "Matt Perry <sirhound@popmotion.io>",

# framesync
A high-performance frame-synced render loop for any JavaScript environment.
A frame-synced render loop for use in any JavaScript environment.
Designed to manage multiple
Discrete render steps allow all processes to be executed in parallel.

@@ -9,6 +9,5 @@ ## Features

- Compatible with all browsers, Node and React Native environments.
- Unity-inspired discrete process steps.
- `willRender` method can provide unnecessary `render` calls.
- Automatically wakes and sleeps based on active processes.
- Lazy processes that run only when other processes are running.
- `willRender` method can prevent unnecessary `render` calls.
- Auto-sleeps when there are no active processes.
- Configurable render steps.

@@ -18,2 +17,3 @@ ## Quick start

### Install
```bash

@@ -40,16 +40,18 @@ npm install framesync --save

This is the order of execution for `Process` steps, once per frame:
This is the default order of execution for `Process` steps, once per frame:
![framesync render loop](/assets/renderloop.png)
framesync will fire the `framestart` method of all active processes, then all the `update` methods and so on.
Framesync will fire the `frameStart` method of all active processes, then all the `update` methods, and so on.
Each step is optional, and each function (if defined) is called with the arguments `process, frameStamp, frameDuration`, in the context of the `Process` itself.
Each step is optional, and each method (if defined) is called with the arguments `process, frameStamp, frameDuration`, in the context of the `Process` itself.
If `willRender` is defined **and** returns `false`, the render methods will be skipped for that frame.
If a Process' `willRender` is defined **and** returns `false`, its render methods will be skipped for that frame.
## API
### Process
### `Process`
A `Process` is a collection of methods to be run once per frame, and can be started/stopped at any time.
#### Create

@@ -87,1 +89,48 @@

### `setSteps`
```javascript
import { setSteps } from 'framesync';
setSteps(stepOrder);
```
#### Arguments
##### `stepOrder` [array]
Array of step definition objects. Steps will be executed in the order of the array.
A step definition must have a `step` property, which is the name of the method to be executed.
Any step can be given a `decideRender` property. Subsequent steps with `isRender` set to `true` will be skipped if its `decideRender` step method returns `false`.
###### Example
```javascript
const stepOrder = [
{ step: 'start' },
{ step: 'willRender', decideRender: true },
{ step: 'preRender', isRender: true },
{ step: 'end' }
];
setSteps(stepOrder);
```
### `setTimeDilation`
```javascript
import { setTimeDilation } from 'framesync';
setTimeDilation(dilation);
```
#### Arguments
##### `dilation` [number]
```javascript
setTimeDilation(0.5); // Timer runs at half speed
setTimeDilation(2); // Timer runs at double speed
```

Sorry, the diff of this file is too big to display

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