소스 검색

docs: urge the user to listen to the `error` event

Jonas Gloning 1 년 전
부모
커밋
0319432d5d
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      lib/peer.ts

+ 5 - 1
lib/peer.ts

@@ -495,7 +495,11 @@ export class Peer extends EventEmitterWithError<PeerErrorType, PeerEvents> {
 
 	/**
 	 * Connects to the remote peer specified by id and returns a data connection.
-	 * @param peer The brokering ID of the remote peer (their {@apilink Peer.id}).
+	 *
+	 * Make sure to listen to the `error` event of the resulting {@link DataConnection}
+	 * in case the connection fails.
+	 *
+	 * @param peer The brokering ID of the remote peer (their {@link Peer.id}).
 	 * @param options for specifying details about Peer Connection
 	 */
 	connect(peer: string, options: PeerConnectOption = {}): DataConnection {