-
Notifications
You must be signed in to change notification settings - Fork 1
feat(utils): the utils now contain a service that wraps around the BroadcastChannel API #253
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
Conversation
…oadcastChannel API
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.
A few comments, mostly to keep it in line with the other packages.
Maybe also update the tags in the package.json?
libs/utils/src/lib/services/broadcast-channel/broadcast-channel.service.ts
Show resolved
Hide resolved
libs/utils/src/lib/services/broadcast-channel/broadcast-channel.service.ts
Outdated
Show resolved
Hide resolved
libs/utils/src/lib/services/broadcast-channel/broadcast-channel.service.ts
Outdated
Show resolved
Hide resolved
return; | ||
} | ||
|
||
if (!this.broadcastChannel[channelName]) { |
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.
Here as well, I'd expect an error not a warn. I'd also refer to the initChannel method here.
libs/utils/src/lib/services/broadcast-channel/broadcast-channel.service.ts
Outdated
Show resolved
Hide resolved
libs/utils/src/lib/services/broadcast-channel/broadcast-channel.service.ts
Outdated
Show resolved
Hide resolved
libs/utils/src/lib/services/broadcast-channel/broadcast-channel.service.ts
Show resolved
Hide resolved
libs/utils/src/lib/services/broadcast-channel/broadcast-channel.md
Outdated
Show resolved
Hide resolved
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.
Service does not implement the whole spec and lacks automatic type inference. Comment about constructor argument signature also applies to function parameters to a lesser extent.
libs/utils/src/lib/services/broadcast-channel/broadcast-channel.service.ts
Outdated
Show resolved
Hide resolved
libs/utils/src/lib/services/broadcast-channel/broadcast-channel.service.ts
Outdated
Show resolved
Hide resolved
libs/utils/src/lib/services/broadcast-channel/broadcast-channel.md
Outdated
Show resolved
Hide resolved
libs/utils/src/lib/services/broadcast-channel/broadcast-channel.service.ts
Outdated
Show resolved
Hide resolved
To recap the feedback into a todo list:
Additional:
|
…hannelService including simplified safety and fully supporting the spec
All feedback has been processed (see checklist). |
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.
Still one BroadcastChannelService
instead of NgxBroadcastChannelService
in the general docs but looks good to me!
|
This PR adds the
BroadcastChannelService
to the utils. This service wraps around the BroadcastChannel API:https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API