handle_reset_serviceworker() {
    if ('serviceWorker' in navigator) {
      navigator.serviceWorker
        .getRegistration(BASE_URL + '/')
        .then(registration => {
          //tell service_worker to cleanup its cache
          if (registration)
            registration.active.postMessage({ action: 'CLEANUP' });

          // console.log('sw:',registration);
          registration
            .unregister()
            .then(is_unregistered => {
              //success, so refresh window
              if (is_unregistered) window.location.reload();
            })
            .catch(error => {
              console.log('unregistration error', error);
            });
        });
    }
  }
//purposefully unregisteres this app's service-worker script
purposefully unregisteres this app's service-worker script
purposefully unregisteres this app ' s service - worker script
handle_reset_serviceworker() {
    if ('serviceWorker' in navigator) {
      navigator.serviceWorker
        .getRegistration(BASE_URL + '/')
        .then(registration => {
          if (registration)
            registration.active.postMessage({ action: 'CLEANUP' });
          registration
            .unregister()
            .then(is_unregistered => {
              if (is_unregistered) window.location.reload();
            })
            .catch(error => {
              console.log('unregistration error', error);
            });
        });
    }
  }
handle_reset_serviceworker ( ) { if ( 'serviceWorker' in navigator ) { navigator . serviceWorker . getRegistration ( BASE_URL + '/' ) . then ( registration => { if ( registration ) registration . active . postMessage ( { action : 'CLEANUP' } ) ; registration . unregister ( ) . then ( is_unregistered => { if ( is_unregistered ) window . location . reload ( ) ; } ) . catch ( error => { console . log ( 'unregistration error' , error ) ; } ) ; } ) ; } }
purposefully unregisteres this app's service-worker script
purposefully unregisteres this app ' s service - worker script
//tell service_worker to cleanup its cache // console.log('sw:',registration); //success, so refresh window