本文整理汇总了TypeScript中meteor/meteor.Meteor.connect方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Meteor.connect方法的具体用法?TypeScript Meteor.connect怎么用?TypeScript Meteor.connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meteor/meteor.Meteor
的用法示例。
在下文中一共展示了Meteor.connect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: reconnect
reconnect() {
let server = ConnectServiceMeteor._getServerURL();
let display = server.result + (server.fromMeteor ? ' (url calculated by meteor)' : ' (url from config)');
console.info('Reconnecting: ' + display + ' Meteor.status(): ' + JSON.stringify(Meteor.status()));
Meteor.connect(server.result);
Meteor.reconnect();
}
示例2: setServerTo
setServerTo(app_url) {
console.log('setting url' + app_url)
Meteor.connection = Meteor.connect(app_url);
_.each(['subscribe', 'methods', 'call', 'apply', 'status','reconnect','disconnect'], function (name) {
Meteor[name] = _.bind(Meteor.connection[name], Meteor.connection);
});
Package.reload = false;
Accounts.connection = Meteor.connection;
}
示例3:
export let generateData = Promise.denodeify((cb) => {
const testConnection = Meteor.connect(Meteor.absoluteUrl());
testConnection.call('tasks', cb);
});
示例4: Promise
export let generateData = () => new Promise((resolve) => {
const testConnection = Meteor.connect(Meteor.absoluteUrl());
testConnection.call('tasks', () => resolve());
});