-
Notifications
You must be signed in to change notification settings - Fork 56
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
[ECO-4115] Split usePresence
hook into different hooks for entering presence and subscribing to presence events
#1674
Conversation
38740e8
to
ee509ee
Compare
usePresence
hook into different hooks for entering presence and subscribing to presence eventsusePresence
hook into different hooks for entering presence and subscribing to presence events
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.
Looks good to me, I think this will be more clear for users than subscribeOnly
option in usePresence
. Added some comments and we need to merge #1676 first
ee509ee
to
a90e9ff
Compare
…s and events as array in `usePresence` Update ClientPresenceConnection in FakeAblySdk used in tests to support passing an array of keys for `subscribe` and `unsubscribe` methods. Update ChannelPresence.triggerSubs in FakeAblySdk to check for empty array of client subscriptions and avoid error if no subscriptions exist for given sub type.
This provides better maintainability (for example, field `extras` was missing in redeclared PresenceMessage, but was present in Ably.PresenceMessage) and provides jsdocs for PresenceMessage fields in intellisense.
c90996a
to
16be38c
Compare
16be38c
to
327e038
Compare
327e038
to
a1aba5a
Compare
@ttypic when removing I think we can solve it by using useRef and using deep equals to check if the value actually changed - if we even need to fix this issue. This was the behavior before and I don't remember seeing issues raised by users regarding this problem, so we can solve it later. |
…scribing to presence events
…Received` callback
a1aba5a
to
efa3ed3
Compare
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.
Looks good, left small comment
efa3ed3
to
2454a28
Compare
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.
LGTM 👍
Resolves #1621
See commit messages for more details