mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Alias Meteor.server.onConnection to Meteor.onConnection
This commit is contained in:
committed by
Nick Martin
parent
41f44b1ad6
commit
6462e2dae9
@@ -4,7 +4,7 @@ Tinytest.addAsync(
|
||||
"livedata server - sessionHandle.onClose()",
|
||||
function (test, onComplete) {
|
||||
var connection;
|
||||
var callbackHandle = Meteor.server.onConnection(function (sessionHandle) {
|
||||
var callbackHandle = Meteor.onConnection(function (sessionHandle) {
|
||||
callbackHandle.stop();
|
||||
test.isTrue(_.isString(sessionHandle.id), "sessionHandle.id exists and is a string");
|
||||
// On the server side, wait for the connection to be closed.
|
||||
@@ -41,7 +41,7 @@ var poll = function (test, onComplete, fn) {
|
||||
|
||||
Tinytest.addAsync("livedata server - sessionHandle.close()", function (test, onComplete) {
|
||||
var connection;
|
||||
var callbackHandle = Meteor.server.onConnection(function (sessionHandle) {
|
||||
var callbackHandle = Meteor.onConnection(function (sessionHandle) {
|
||||
callbackHandle.stop();
|
||||
|
||||
poll(test, onComplete, function () {
|
||||
@@ -77,7 +77,7 @@ Tinytest.addAsync(
|
||||
"livedata server - sessionId in method invocation",
|
||||
function (test, onComplete) {
|
||||
var sessionId;
|
||||
var callbackHandle = Meteor.server.onConnection(function (sessionHandle) {
|
||||
var callbackHandle = Meteor.onConnection(function (sessionHandle) {
|
||||
callbackHandle.stop();
|
||||
sessionId = sessionHandle.id;
|
||||
});
|
||||
@@ -96,7 +96,7 @@ Tinytest.addAsync(
|
||||
"livedata server - session in nested method invocation",
|
||||
function (test, onComplete) {
|
||||
var sessionId;
|
||||
var callbackHandle = Meteor.server.onConnection(function (sessionHandle) {
|
||||
var callbackHandle = Meteor.onConnection(function (sessionHandle) {
|
||||
callbackHandle.stop();
|
||||
sessionId = sessionHandle.id;
|
||||
});
|
||||
@@ -114,7 +114,7 @@ Tinytest.addAsync(
|
||||
Tinytest.addAsync(
|
||||
"livedata server - session data in nested method invocation",
|
||||
function (test, onComplete) {
|
||||
var callbackHandle = Meteor.server.onConnection(function (session) {
|
||||
var callbackHandle = Meteor.onConnection(function (session) {
|
||||
callbackHandle.stop();
|
||||
session._sessionData.foo = 123;
|
||||
});
|
||||
|
||||
@@ -24,14 +24,14 @@ if (Package.webapp) {
|
||||
|
||||
// Proxy the public methods of Meteor.server so they can
|
||||
// be called directly on Meteor.
|
||||
_.each(['publish', 'methods', 'call', 'apply'],
|
||||
_.each(['publish', 'methods', 'call', 'apply', 'onConnection'],
|
||||
function (name) {
|
||||
Meteor[name] = _.bind(Meteor.server[name], Meteor.server);
|
||||
});
|
||||
} else {
|
||||
// No server? Make these empty/no-ops.
|
||||
Meteor.server = null;
|
||||
Meteor.refresh = function (notificatio) {
|
||||
Meteor.refresh = function (notification) {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user