Stub broadcast channel for unspported contexts (#2175)
parent
c6ab6e8b8e
commit
e7141a77d8
|
@ -1,11 +1,2 @@
|
||||||
export default class BroadcastChannel {
|
import Stub from '#/lib/broadcast/stub'
|
||||||
constructor(public name: string) {}
|
export default Stub
|
||||||
postMessage(_data: any) {}
|
|
||||||
close() {}
|
|
||||||
onmessage: (event: MessageEvent) => void = () => {}
|
|
||||||
addEventListener(_type: string, _listener: (event: MessageEvent) => void) {}
|
|
||||||
removeEventListener(
|
|
||||||
_type: string,
|
|
||||||
_listener: (event: MessageEvent) => void,
|
|
||||||
) {}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
export default BroadcastChannel
|
import Stub from '#/lib/broadcast/stub'
|
||||||
|
export default 'BroadcastChannel' in window ? window.BroadcastChannel : Stub
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
export default class BroadcastChannel {
|
||||||
|
constructor(public name: string) {}
|
||||||
|
postMessage(_data: any) {}
|
||||||
|
close() {}
|
||||||
|
onmessage: (event: MessageEvent) => void = () => {}
|
||||||
|
addEventListener(_type: string, _listener: (event: MessageEvent) => void) {}
|
||||||
|
removeEventListener(
|
||||||
|
_type: string,
|
||||||
|
_listener: (event: MessageEvent) => void,
|
||||||
|
) {}
|
||||||
|
}
|
Loading…
Reference in New Issue