Created
March 9, 2021 11:50
Revisions
-
dr-dimitru created this gist
Mar 9, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ // !!! THIS IS META CODE, NOT A REAL SUGGESTION TO A CODEBASE // JUST VERY SIMPLIFIED FORM OF PROPOSAL Meteor._user = new ReactiveVar(null); Meteor._userId = new ReactiveVar(null); Tracker.autorun(() => { Meteor._user.set(Meteor.user() || null); }); Tracker.autorun(() => { Meteor._userId.set(Meteor.userId() || null); }); Template.registerHelper('currentUser', () => Meteor._user.get()); Meteor.user = Meteor._user.get.bind(Meteor._user); Meteor.userId = Meteor._userId.get.bind(Meteor._userId);