- commit
- ab8c745e6885ef4f5f24d19a05f54ae8f56708ba
- parent
- 4afc82bc120b7730504ae84e79049a1ac4c9b548
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2020-01-02 10:29
rename update() to render()
Diffstat
| M | src/index.js | 6 | +++--- |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/index.js b/src/index.js
@@ -12,7 +12,7 @@ const init = function(wrapper) {
12 12 wrapper.append(element);
13 13 };
14 14
15 -1 const update = function() {
-1 15 const render = function() {
16 16 const newTree = template(state);
17 17 petitDom.patch(newTree, tree);
18 18 tree = newTree;
@@ -23,7 +23,7 @@ const on = function(eventType, selector, fn) {
23 23 const target = event.target.closest(selector);
24 24 if (target) {
25 25 fn.call(target, state, event);
26 -1 update();
-1 26 render();
27 27 }
28 28 });
29 29 };
@@ -43,7 +43,7 @@ const play = function() {
43 43 }
44 44 }
45 45 logic.calculateNextGen(state);
46 -1 update();
-1 46 render();
47 47 const speed = document.querySelector('[name="speed"]').value;
48 48 const timeout = 2000 * Math.pow(0.95, speed);
49 49 setTimeout(play, timeout);