MCPcopy Index your code
hub / github.com/microsoft/SandDance / getDiffIcons

Function getDiffIcons

docs/app/js/sanddance-app.js:99454–99476  ·  view source on GitHub ↗
(data, getIcon, cachedIcons)

Source from the content-addressed store, hash-verified

99452 };
99453}
99454function getDiffIcons(data, getIcon, cachedIcons) {
99455 if (!data || !getIcon) return null;
99456 cachedIcons = cachedIcons || {};
99457 var icons = {};
99458 var _createIterable = (0, _core2.createIterable)(data), iterable = _createIterable.iterable, objectInfo = _createIterable.objectInfo;
99459 var _iterator = _createForOfIteratorHelper(iterable), _step;
99460 try {
99461 for(_iterator.s(); !(_step = _iterator.n()).done;){
99462 var object = _step.value;
99463 objectInfo.index++;
99464 var icon = getIcon(object, objectInfo);
99465 var id = getIconId(icon);
99466 if (!icon) throw new Error("Icon is missing.");
99467 if (!icon.url) throw new Error("Icon url is missing.");
99468 if (!icons[id] && (!cachedIcons[id] || icon.url !== cachedIcons[id].url)) icons[id] = icon;
99469 }
99470 } catch (err) {
99471 _iterator.e(err);
99472 } finally{
99473 _iterator.f();
99474 }
99475 return icons;
99476}
99477var IconManager = function() {
99478 function IconManager1(gl, _ref2) {
99479 var _ref2$onUpdate = _ref2.onUpdate, onUpdate = _ref2$onUpdate === void 0 ? noop : _ref2$onUpdate;

Callers 1

sanddance-app.jsFile · 0.70

Calls 3

getIconFunction · 0.85
getIconIdFunction · 0.70

Tested by

no test coverage detected