Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Meteor Cookbook
  • Toc
  • feedback
Meteor Cookbook

Meteor Cookbook

By : Isaac Strack
4.4 (5)
close
Meteor Cookbook

Meteor Cookbook

4.4 (5)
By: Isaac Strack

Overview of this book

This book is meant for developers of all experience levels looking to create mobile and full-stack web applications in JavaScript. Many of the simple recipes can easily be followed by less-experienced developers, while some of the advanced recipes will require extensive knowledge of existing web, mobile, and server technologies. Any application or enterprise web developer looking to create full-stack JavaScript-based apps will benefit from the recipes and concepts covered in this book.
Table of Contents (14 chapters)
close
13
Index

Handling asynchronous events


Meteor is a reactive framework. As you've probably noticed, it's built on top of Node.js, but when writing or using packages, it somehow magically avoids all of the callback and event loop drama you'd normally face with Node.js. Meteor lets you code in a declarative, synchronous-like style. This recipe will show you one of the ways Meteor does this, and how you can handle asynchronous events coming in from a third-party package. In this case, we will read an incoming Twitter stream from the npm twit package.

Getting ready

We need to quickly set up a test application on Twitter and load the npm twit module, so we'll do that here, so as not to distract from the recipe itself. Note that you can use any asynchronous event stream you would like for this recipe, including the standard setInterval() method, which could be used to mimic an asynchronous event stream.

Creating a baseline Meteor app

Open a terminal window, navigate to where you would like your project to reside...

bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete