Skip to content

Instantly share code, notes, and snippets.

@fakenickels
Created September 27, 2015 00:06
Show Gist options
  • Save fakenickels/4571d3dce4befacf59fa to your computer and use it in GitHub Desktop.
Save fakenickels/4571d3dce4befacf59fa to your computer and use it in GitHub Desktop.
Meteor Session similar in ES2015
SessionHandler = {
_deps: new Tracker.Dependency,
get(target, name){
this._deps.depend();
return target[name];
},
set(target, name, value){
target[name] = value;
this._deps.changed();
}
}
Session = new Proxy({}, SessionHandler);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment