Skip to content

Commit 6f44634

Browse files
committedOct 19, 2015
Wait on the post subscription
chapter5-2
1 parent 8ec7e07 commit 6f44634

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed
 

‎.meteor/packages

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ insecure # Allow all DB writes from clients (for prototyping)
2020
twbs:bootstrap
2121
underscore
2222
iron:router@1.0.0-rc.1
23+
sacha:spin

‎.meteor/versions

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ reactive-var@1.0.6
5959
reload@1.1.4
6060
retry@1.0.4
6161
routepolicy@1.0.6
62+
sacha:spin@2.3.1
6263
session@1.1.1
6364
spacebars@1.0.7
6465
spacebars-compiler@1.0.7

‎client/main.js

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
Meteor.subscribe('posts');
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<template name="loading">
2+
{{> spinner}}
3+
</template>

‎lib/router.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Router.configure({
2-
layoutTemplate: 'layout'
2+
layoutTemplate: 'layout',
3+
loadingTemplate: 'loading',
4+
waitOn: function() { return Meteor.subscribe('posts'); }
35
});
46

57
Router.route('/', {name: 'postsList'});

1 commit comments

Comments
 (1)

Vivais commented on Dec 4, 2017

@Vivais

for windows user:
meteor add sacha:spin

Please sign in to comment.