I’m implement a simple infinite scroll with React + Iron Router
Here is my subscribe code:
Template.home.onCreated(function () {
Session.set('limit', 20);
Deps.autorun(function () {
subs.subscribe('data', Session.get('limit'))
});
});
And my router file is got in project/lib/router.js (It’s global both server & client)
Router.route('home', {
path: '/',
waitOn () {
return subs.subscribe('anotherData');
},
fastRender: true
});
When i update session “limit” in another function, page got reload. And anotherData got empted.
Can anyone help me?