-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: simplify streaming http response code and use instances of pub…
…sub tracker instead of a singleton (#3719) Simplifies deps, pass peer id as string instead of cid.
- Loading branch information
1 parent
1523e33
commit 13c641e
Showing
5 changed files
with
84 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
'use strict' | ||
|
||
const SubscriptionTracker = require('./subscription-tracker') | ||
|
||
/** | ||
* @param {import('../types').Options} config | ||
*/ | ||
module.exports = config => ({ | ||
ls: require('./ls')(config), | ||
peers: require('./peers')(config), | ||
publish: require('./publish')(config), | ||
subscribe: require('./subscribe')(config), | ||
unsubscribe: require('./unsubscribe')(config) | ||
}) | ||
module.exports = config => { | ||
const subscriptionTracker = new SubscriptionTracker() | ||
|
||
return { | ||
ls: require('./ls')(config), | ||
peers: require('./peers')(config), | ||
publish: require('./publish')(config), | ||
subscribe: require('./subscribe')(config, subscriptionTracker), | ||
unsubscribe: require('./unsubscribe')(config, subscriptionTracker) | ||
} | ||
} |
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
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