-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactors code to use the component logger from libp2p to allow more flexible logging patterns. Refs: https://github.com/libp2p/js-libp2p/issue/2105 Refs: libp2p/js-libp2p#2198 Refs: https://github.com/libp2p/js-libp2p/issue/378
- Loading branch information
1 parent
8495ae3
commit 44ec1ad
Showing
5 changed files
with
35 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import { Yamux } from './muxer.js' | ||
import type { YamuxMuxerInit } from './muxer.js' | ||
import type { StreamMuxerFactory } from '@libp2p/interface/stream-muxer' | ||
import type { ComponentLogger } from '@libp2p/logger' | ||
export { GoAwayCode } from './frame.js' | ||
|
||
export function yamux (init: YamuxMuxerInit = {}): () => StreamMuxerFactory { | ||
return () => new Yamux(init) | ||
export interface YamuxComponents { | ||
logger: ComponentLogger | ||
} | ||
|
||
export function yamux (init: YamuxMuxerInit = {}): (components: YamuxComponents) => StreamMuxerFactory { | ||
return (components) => new Yamux(components, init) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters