O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The live clock cog

When we called the Start method on the time ago cog, the time was rendered on the web page using the virtual DOM, instead of a replace inner HTML operation taking place. Since the time ago cog, only updates the time once, upon calling the Start method of the cog, it's hard to appreciate the cog's virtual DOM in action.

In this example, we're going to build a live clock Cog, which has the ability to display the current time of any place in the world. Since we'll be displaying the time to the seconds, we'll be performing a SetProp operation every second to re-render the live clock Cog.

Figure 9.7 is an illustration of the live clock:

Figure 9.7: An illustration depicting the live clock cog

We'll be rendering the current ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required