feat(utils): the utils now contain a service that wraps around the BroadcastChannel API#253
Conversation
…oadcastChannel API
IbenTesara
left a comment
There was a problem hiding this comment.
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.
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
ian-emsens-shd
left a comment
There was a problem hiding this comment.
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). |
IbenTesara
left a comment
There was a problem hiding this comment.
Still one BroadcastChannelService instead of NgxBroadcastChannelService in the general docs but looks good to me!
|
This PR adds the
BroadcastChannelServiceto the utils. This service wraps around the BroadcastChannel API:https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API