 	private func triggerInternalEvent(event: Event.PhoenixEvent, withMessage message: Message) {
 		switch event {
 		case .Join:
+			state = .Joined
 			onJoin?(message: message)
 		case .Reply:
 			onReply?(message: message)
 		case .Heartbeat:
 			onHeartbeat?(message: message)
 		case .Error:
+			state = .Errored
 			onError?(message: message)
 		case .Leave:
 			onLeave?(message: message)
 		case .Close:
+			state = .Closed
 			onClose?(message: message)
 		}
 	}

	public func leave() {
		let leaveMessage = Message(
			topic: topic,
			event: Event.Default(.Leave)
		)

		sendMessage(leaveMessage) { [weak self] result in
			self?.state = .Closed
			do {
				let message = try result.value()



	- parameter completion:	<#completion description#>
	*/
	public func join() {
		guard state == .Closed || state == ChannelState.Errored else {
			return
		}
		
		state = .Joining
		let joinMessage = Message(
			topic: topic,
			event: Event.Phoenix(.Join),
			payload: [:]
		)
		
		sendMessage(joinMessage, completion: nil)
	}

	/**
