Chapter 5. Fully reactive editing
This chapter covers
- Building reactive forms
- Using reactive data bindings to update views
- Working with unsynchronized, or local, collections
- Displaying collection data within forms and performing updates reactively
- Implementing a simple notifications system
In chapter 4 you created a fully functional yet basic application that allows users to select, view, add, and delete houses. Because you used reactive data sources, you didn’t have to manipulate the DOM tree—for example, adding a new option element to the drop-down list when you created a new house—Meteor’s reactivity took care of it for you.
The most common approach to front-end development is manual DOM manipulation, but it’s tedious and error-prone. In most frameworks, data is retrieved from a back end and needs to be inserted into the DOM somehow. If a new database entry is sent to the client, a library like jQuery is used to add a new li element or table row. Although this approach is straightforward, it tends to make code overly complex and forces you to explicitly add changes for all occurrences inside a page. Many people associate front-end coding with DOM manipulations, but Meteor allows you to focus on data only and let it perform any changes to views and templates. In this chapter you’ll be taking advantage of reactive data bindings that limit the amount of code required and make the application more robust.