#MessageChannel

MessageChannel用法总结

MessageChannel,顾名思义,通信管道,可以实现两端的通信。基本用法:varchannel=newMessageChannel();varport1=channel.port1;varport2=channel.port2;port1.onmessage=function(event){console.log...
代码星球 ·2020-06-29