   # * wswrapper : WebSocketWrapper
   # * topic : topic to listen on (send to the server on connect)
   # * apikey : apikey for server
-  $.when(wswrapper.connected).then(() ->
-    msg = JSON.stringify(
-      {msgtype : 'subscribe', topic : topic, auth : apikey}
-    )
-    wswrapper.s.send(msg)
-  )
+  wswrapper.subscribe(topic, apikey)
   wswrapper.on("msg:" + topic, (msg) ->
     msgobj = JSON.parse(msg)
     if msgobj['msgtype'] == 'modelpush'

    @trigger("msg:" + topic, data)
    return null


# ###function : submodels


  _.extend(@prototype, Backbone.Events)
  # ### method :
  constructor : (ws_conn_string) ->
    @auth = {}
    @ws_conn_string = ws_conn_string
    @_connected = $.Deferred()
    @connected = @_connected.promise()
