This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
feat: update publish function signature #62
Merged
Merged
Conversation
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
BREAKING CHANGE: the publish function signature now takes a single message as its second parameter, instead of optionally an array of messages.
wemeetagain
commented
Jul 14, 2020
src/index.js
Outdated
@@ -314,11 +314,11 @@ class PubsubBaseProtocol extends EventEmitter { | |||
* For example, a Floodsub implementation might simply publish each message to each topic for every peer | |||
* @abstract | |||
* @param {Array<string>|string} topics | |||
* @param {Array<any>|any} messages | |||
* @returns {Promise} | |||
* @param {Buffer | string} message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
* @param {Buffer | string} message | |
* @param {Buffer} message |
Considering that we are breaking this, I would go with only Buffer, to be the same as https://github.com/libp2p/js-libp2p/blob/master/doc/API.md#pubsubpublish
What do you think? Reducing the scope means less code to maintain and less edge cases that might appear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I just set this bc that is what the protobuf encoder will accept.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds fair to me
vasco-santos
approved these changes
Jul 15, 2020
26 tasks
vasco-santos
pushed a commit
that referenced
this pull request
Aug 11, 2020
BREAKING CHANGE: the publish function signature now takes a single message as its second parameter, instead of optionally an array of messages.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #51
BREAKING CHANGE: the publish function signature now takes a single
message as its second parameter, instead of optionally an array of
messages.