Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FCE-929] Add useUpdatePeerMetadata hook #254

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mironiasty
Copy link
Member

Description

Instead of static method, let's have hook that will allow updating metadata.

I also updated jsdoc comments - to remove deprecated methods from existing categories (so they are not easily discoverable in documentation)

Motivation and Context

Let's have unified API that rely mostly on hooks

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Screenshots (if appropriate)

Copy link

linear bot commented Nov 27, 2024

@mironiasty mironiasty marked this pull request as ready for review November 27, 2024 13:22
* @param peerMetadata string indexed record with metadata, that will be available to all other peers
* @category Connection
*/
updatePeerMetadata,
Copy link
Collaborator

@MiloszFilimowski MiloszFilimowski Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: This is already a static reference so useCallback does not add anything here, it could be written as such:

updatePeerMetadata: RNFishjamClientModule.updatePeerMetadata<PeerMetadata>

but I'm ok with useCallback solution as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about it - and decided to go for useCallback to made it more explicit. But I don't have strong opinion on which solution is better 🤷

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then let's leave it as it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants