user2191332
user2191332

Reputation: 1119

Meteor Session variables and jquery events

I have been mixing uses of Meteor Session variables / Deps.autorun and jquery .trigger / .on for reactive purposes. I am wondering, if the reactivity does not involve data displayed in the UI, is it better to use jquery events?

Is there any advantage of using one over the other such as performance, in case I start having lots of activities, timeouts, canvas rendering, etc?

Upvotes: 0

Views: 137

Answers (1)

Hubert OG
Hubert OG

Reputation: 19544

Currently, using jQuery to manipulate your DOM is really painful. When template rerenders, you lose all the manipulations you've made, unless you've placed the element in #constant block or did some other precautions to ensure the state is saved. Whatever method you've used for this, it will most probably be deprecated in Blaze, which thankfully should make such manipulations easier.

For now, it's better to stick with the convention and stick with reactivity for any change that involves even simple manipulation with your data.

Upvotes: 2

Related Questions