  * After channel is loaded it binds to channel events,
  * emits LOAD_CHANNEL_SUCCESS event and load channel messages
  *
- * @param {function} func - function which loads a channel
- * @param {object} params - func parameters
+ * @param {function} fn - function which loads a channel
+ * @param {object} params - fn parameters
  * @return {Promise}
 ###
-loadChannelWithFn = (func, params) ->
+loadChannelWithFn = (fn, params) ->
 
   { LOAD_CHANNEL_BEGIN
     LOAD_CHANNEL_FAIL

###
loadChannel = (id) ->

  func   = kd.singletons.socialapi.channel.byId
  params = { id }

  loadChannelWithFn func, params


###*

  name   = name.toLowerCase()
  type   = getChannelTypeByName name
  params = { name, type }
  fn     = kd.singletons.socialapi.channel.byName

  loadChannelWithFn fn, params


###*
