本文整理匯總了TypeScript中meteor/session.Session.equals方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Session.equals方法的具體用法?TypeScript Session.equals怎麽用?TypeScript Session.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類meteor/session.Session
的用法示例。
在下文中一共展示了Session.equals方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: alert
Tracker.autorun(function (c) {
if (!Session.equals("shouldAlert", true))
return;
c.stop();
alert("Oh no!");
});
示例2: function
* From Sessions, Session.get section
*/
// Page will say "We've always been at war with Eastasia"
// DA: commented out since transpiler didn't like append()
//document.body.append(frag1);
// Page will change to say "We've always been at war with Eurasia"
Session.set("enemy", "Eurasia");
/**
* From Sessions, Session.equals section
*/
var value: string;
Session.get("key") === value;
Session.equals("key", value);
/**
* From Accounts, Meteor.users section
*/
Meteor.publish("userData", function () {
return Meteor.users.find({ _id: this.userId },
{ fields: { 'other': 1, 'things': 1 } });
});
Meteor.users.deny({ update: function () { return true; } });
/**
* From Accounts, Meteor.loginWithExternalService section
*/
Meteor.loginWithGithub({