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
Building Single-page Web Apps with Meteor

You're reading from   Building Single-page Web Apps with Meteor Build real-time single page apps at lightning speed using the most powerful full-stack JavaScript framework around

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher
ISBN-13 9781783988129
Length 198 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Fabian Vogelsteller Fabian Vogelsteller
Author Profile Icon Fabian Vogelsteller
Fabian Vogelsteller
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Getting Started with Meteor 2. Building HTML Templates FREE CHAPTER 3. Storing Data and Handling Collections 4. Controlling the Data Flow 5. Making Our App Versatile with Routing 6. Keeping States with Sessions 7. Users and Permissions 8. Security with the Allow and Deny Rules 9. Advanced Reactivity 10. Deploying Our App 11. Building Our Own Package 12. Testing in Meteor A. Appendix Index

Creating our own package

To create our own package, we will use our ReactiveTimer object, which we built in Chapter 9, Advanced Reactivity:

  1. We go to our terminal, in our app's folder and run the following command:
    $ meteor create --package reactive-timer
    
  2. This will create a folder named packages with a reactive-timer folder inside it. Inside the reactive-timer folder, Meteor has already created a package.js file and some example package files.
  3. Now we can delete all the files inside the reactive-timer folder, except the package.js file.
  4. Then we move the my-meteor-blog/client/ReactiveTimer.js file, which we created in Chapter 9, Advanced Reactivity, to our newly created reactive-timer package folder.
  5. Lastly, we open the copied ReactiveTimer.js file and remove the following lines:
    timer = new ReactiveTimer();
    timer.start(10);

    Later, we'll instantiate the timer object inside the app itself and not in the package file.

We should now have a simple folder with the default package.js file and...

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