Attaching client data to the server connection


I’m thinking of making a package out of this, and wondering whether anyone has feedback on how this is being done – via a method on page load and DDP.onReconnect:

# client 'attachData', localStorage.getItem 'clientData'

Meteor.connection.onReconnect -> 'attachData', localStorage.getItem 'clientData'

setTimeout -> 'logData'
, 1000

# server
  attachData: (data) -> = data

  logData: ->

This seems to be working, but I’m unfamiliar with this.connection. Given this setup, will always be there? Should I be using Meteor.connection or Meteor.default_connection?


@mizzao thought you might be familiar with this?