Dominaezzz
08/06/2019, 10:26 AMBroadcastChannel but I'm not sure how to expose it. Should I literally expose the BroadcastChannel for users to call openSubscription() or should I wrap this up?Zach Klippenstein (he/him) [MOD]
08/06/2019, 4:11 PMBroadcastChannel includes both the read side and the write side. Assuming you don't want your API consumers to be able to send their own values, it's better to keep the channel private. The read half of BroadcastChannel naturally maps to a Flow, and there's an extension function to convert it: asFlow() (there was even talk of making BroadcastChannel implement Flow directly for a while).Dominaezzz
08/07/2019, 11:12 AM