Skip to content

Commit

Permalink
Un-deprecate the NetworkAdapter class (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
acurrieclark authored Mar 19, 2024
1 parent 217c369 commit 1167268
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/automerge-repo/src/network/NetworkAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import { Message } from "./messages.js"
import { NetworkAdapterInterface } from "./NetworkAdapterInterface.js"

/** An interface representing some way to connect to other peers
* @deprecated use {@link NetworkAdapterInterface}
*
* @remarks
* The {@link Repo} uses one or more `NetworkAdapter`s to connect to other peers.
* Because the network may take some time to be ready the {@link Repo} will wait
* until the adapter emits a `ready` event before it starts trying to use it
*
* This utility class can be used as a base to build a custom network adapter. It
* is most useful as a simple way to add the necessary event emitter functionality
*/
export abstract class NetworkAdapter
extends EventEmitter<NetworkAdapterEvents>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ export interface PeerMetadata {
* The {@link Repo} uses one or more `NetworkAdapter`s to connect to other peers.
* Because the network may take some time to be ready the {@link Repo} will wait
* until the adapter emits a `ready` event before it starts trying to use it
*
* The {@link NetworkAdapter} is an abstract class that can be used as a base to build a
* custom network adapter. It is most useful as a simple way to add the necessary event
* emitter functionality
*/
export interface NetworkAdapterInterface extends EventEmitter<NetworkAdapterEvents> {
export interface NetworkAdapterInterface
extends EventEmitter<NetworkAdapterEvents> {
peerId?: PeerId
peerMetadata?: PeerMetadata

Expand Down

0 comments on commit 1167268

Please sign in to comment.