Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with Meteor.js JavaScript Framework - Second Edition

You're reading from   Getting Started with Meteor.js JavaScript Framework - Second Edition Learn to develop powerful web applications in minutes with Meteor

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781785285547
Length 138 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Creating a reaction

Following the creation of our basic template and collection, and with Meteor putting our lists collection into the reactive context, we can now proceed to watch the reactive programming model in action.

Navigate to our Lending Library page at http://localhost:3000/ and open the browser console window.

In the console, enter the following command:

> lists.insert({Category:"Fraggles"});

You will instantly see the page update. Note that, this time, the full page didn't refresh! This is because, under the hood, Meteor is tracking changes to our reactive context (in this case, the lists collection) and the template is being updated immediately after a change is made.

Let's make a few more changes. To do this, enter the same Fraggles command again:

> lists.insert({Category:"Fraggles"});

Just as before, a new Fraggles button will instantly appear:

Creating a reaction

But, we have too many Fraggles categories now. There are a lot of Fraggles, but unless you're...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image