MCPcopy Create free account
hub / github.com/CSAILVision/gandissect / tweenFunction

Function tweenFunction

client_dist/vendor.js:25513–25536  ·  view source on GitHub ↗
(id, name, value)

Source from the content-addressed store, hash-verified

25511}
25512
25513function tweenFunction(id, name, value) {
25514 var tween0, tween1;
25515 if (typeof value !== "function") throw new Error;
25516 return function() {
25517 var schedule = Object(_schedule__WEBPACK_IMPORTED_MODULE_0__["set"])(this, id),
25518 tween = schedule.tween;
25519
25520 // If this node shared tween with the previous node,
25521 // just assign the updated shared tween and we’re done!
25522 // Otherwise, copy-on-write.
25523 if (tween !== tween0) {
25524 tween1 = (tween0 = tween).slice();
25525 for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {
25526 if (tween1[i].name === name) {
25527 tween1[i] = t;
25528 break;
25529 }
25530 }
25531 if (i === n) tween1.push(t);
25532 }
25533
25534 schedule.tween = tween1;
25535 };
25536}
25537
25538/* harmony default export */ __webpack_exports__["default"] = (function(name, value) {
25539 var id = this._id;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected