This app is a modification the default app created by meteor after meteor create app.

Reactivity App on Github



– Commit: 024c164

The Reactivity app saves the click counter in the server and is common to all clients. When a client clicks on the button, the other clients are updated.

In the default meteor app, the click counter is saved in locally in each client, clients don’t have a common counter.

The counter is saved in a mongodb collection on the server. The clients update the counter on the server when the button is clicked. Meteor then sends the update to all connected clients.

  1. create a mongo collection on client and server
  2. the server initializes the counter in the collection
  3. the counter is shown in the ‘hello’ template. Meteor updates the counter automatically
  4. when the button is clicked, the counter increases by 1

Update 2014-04-16 Commit: 5ffe745

This version sets up a timer on the server that triggers every 2000ms. When the trigger happens, it calls a function that updates the counter in the collection. The updates are reflected immediatly on all connected clients.

Diff compare to version 1

Try it:

git clone
cd meteor_reactivity