From the course: Data Analytics with Observable

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Reactivity and the order of operations

Reactivity and the order of operations - Observable Tutorial

From the course: Data Analytics with Observable

Reactivity and the order of operations

- [Host] One of the things I love most about observable is that it's completely reactive and the flow of the reactivity has nothing to do with the order of the code on the page. Instead, it's about the actual dependencies of the code. Let me explain and demonstrate, starting with how a webpage usually works. As you can see in this very simple HTML page I've created, I have code up here that's just trying to put some text into an HTML element, but it's erroring. Why? Because it's trying to put text into an HTML element that doesn't exist yet. As far as the browser is concerned, you see code in a webpage runs from top to bottom in order. So this here, the element where the text is supposed to go doesn't exist yet. When this code up here is firing. Now, if I take this code and I actually move it below and save it and refresh the page, look what happens. The error goes away and the text shows up over here as expected. So…

Contents