Managing our views

Again, the views are Ractive.js components. They have their own templates. In fact, the Home.js module can also be called a view. The Model-View-Controller pattern in the browser is often transformed, and it does not follow the exact definitions. This is the case with our application because we are using a framework that has some rules and which provides specific functionalities that do not align with the typical MVC. Of course, there is nothing wrong with this. As long as we separate the responsibilities, our architecture will be in good shape.

The navigation view is fairly simple. It just defines the template that needs rendering:

// views/navigation.js module.exports = Ractive.extend({ template: require('../../tpl/navigation') ...

Get Node.js By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.