Skip to content

Instantly share code, notes, and snippets.

View povesteam's full-sized avatar

Ruben Sainiuc povesteam

View GitHub Profile
@veered
veered / tracker.js
Last active May 28, 2019 22:12
Some bonus features for Tracker
// Only trigger enclosing computation if the return value of
// f is not EJSON.equals to the previuous return value
Tracker.guard = function(f) {
if (Meteor.isServer || !Tracker.currentComputation) {
return f();
}
let dep = new Tracker.Dependency(),
curView = Blaze.currentView,
tplFunc = Template._currentTemplateInstanceFunc;