Bharat
Bharat

Reputation: 2479

Meteor JS tutorial - sessions are reactive?

I am working through the Meteor tutorial on the meteor site.

I am confused about Sessions being reactive components as explained in step 8

I think that the tutorial means that clicking on hide checkbox should hide the completed tasks ACROSS ALL connected clients since sessions are reactive,is that true?

Because when I check the Hide Completed Tasks in a client browser, only that client's display hides the completed task.

Should this not automatically happen in the other browser?

NOTE I have both Chrome and Firefox open and connected, but Hide Completed Tasks works independently and is not synchronized across the browser.

Upvotes: 0

Views: 151

Answers (1)

Ethaan
Ethaan

Reputation: 11376

Session is the same way, but is not synced with the server like collections are

like the document says.

So if you open the console on chrome and type Session.get("hideCompleted"); you will get undefined, thats because the state of the Session on Google chrome doesn't exist on Mozilla.

sessions are reactive?? yes Sessions are reactive, thats means that Sessions can change the state from a template an re-render it.

Sessions are god to do changes on the Current Template instance,again like the document says.

This makes Session a convenient place to store temporary UI state like the checkbox above

Upvotes: 1

Related Questions