demos/network-idle.js
function handleMessage(event) {
  if (!event.data) {
    return;
  }

  switch (event.data) {
    case 'NETWORK_IDLE_ENQUIRY_RESULT_IDLE':
    case 'NETWORK_IDLE_CALLBACK':
      networkIdleCallback.__callbacks__.forEach(callback => {
        networkIdleCallback.__popCallback__(callback, false);
      });
      break;
  }
}
function handleMessage(event) {
  if (!event.data) {
    return;
  }

  switch (event.data) {
    case 'NETWORK_IDLE_ENQUIRY_RESULT_IDLE':
    case 'NETWORK_IDLE_CALLBACK':
      networkIdleCallback.__callbacks__.forEach(callback => {
        networkIdleCallback.__popCallback__(callback, false);
      });
      break;
  }
}
function handleMessage ( event ) { if ( ! event . data ) { return ; } switch ( event . data ) { case 'NETWORK_IDLE_ENQUIRY_RESULT_IDLE' : case 'NETWORK_IDLE_CALLBACK' : networkIdleCallback . __callbacks__ . forEach ( callback => { networkIdleCallback . __popCallback__ ( callback , false ) ; } ) ; break ; } }
Handle message passing
@param {*} event - A valid event
Handle message passing