我想象的是这样的:
# client
Meteor.call 'attachData', localStorage.getItem 'clientData'
Meteor.connection.onReconnect ->
Meteor.call 'attachData', localStorage.getItem 'clientData'
setTimeout ->
Meteor.call 'logData'
, 1000
# server
Meteor.methods
attachData: (data) ->
this.connection.data = data
logData: ->
console.log this.connection.data
Run Code Online (Sandbox Code Playgroud)
这似乎有效,但我不熟悉this.connection.鉴于此设置,将this.connection.data永远存在?我应该使用Meteor.connection还是Meteor.default_connection?