code: function _loop(i) {
  				var eventName = eventNames[i];
  				var actionGroup = instructions[eventName];
  
  				ws.addEventListener(eventName, function (res) {
  
  					processActionGroup({ res: res, actionGroup: actionGroup });
  
  					// TODO handle sending messages
  				});
  			}
docs: TODO add all possible event names handle non-error events