Commit ab8c745e authored by Tobias Bengfort's avatar Tobias Bengfort
Browse files

rename update() to render()

parent 4afc82bc
......@@ -12,7 +12,7 @@ const init = function(wrapper) {
wrapper.append(element);
};
const update = function() {
const render = function() {
const newTree = template(state);
petitDom.patch(newTree, tree);
tree = newTree;
......@@ -23,7 +23,7 @@ const on = function(eventType, selector, fn) {
const target = event.target.closest(selector);
if (target) {
fn.call(target, state, event);
update();
render();
}
});
};
......@@ -43,7 +43,7 @@ const play = function() {
}
}
logic.calculateNextGen(state);
update();
render();
const speed = document.querySelector('[name="speed"]').value;
const timeout = 2000 * Math.pow(0.95, speed);
setTimeout(play, timeout);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment