forked from tensorflow/minigo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.js
More file actions
28 lines (28 loc) · 855 Bytes
/
Copy pathview.js
File metadata and controls
28 lines (28 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class ViewPainter {
constructor() {
this.pendingViews = [];
}
draw(view) {
if (this.pendingViews.length == 0) {
window.requestAnimationFrame(() => {
for (let view of this.pendingViews) {
view.drawImpl();
}
this.pendingViews = [];
});
}
if (this.pendingViews.indexOf(view) == -1) {
this.pendingViews.push(view);
}
}
}
let painter = new ViewPainter();
class View {
draw() { painter.draw(this); }
}
exports.View = View;
});
//# sourceMappingURL=view.js.map