June 2016
Intermediate to advanced
910 pages
18h 59m
English
We have to manually refresh the display for updates. Because ReactJS is so fast, we really can afford to wastefully render the page every millisecond. We put the following code at the end, just preceding the end of the immediately invoked function expression:
var update = function() {
React.render(<Pragmatometer />,
document.getElementById('main'));
};
update();
var update_interval = setInterval(update, 1);
})();For the last major piece of our puzzle, let's look at an HTML skeleton that will house these components for now. The HTML is not especially interesting, but is provided with an interest in reducing guesswork:
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Pragmatometer</title> ...
Read now
Unlock full access