code: function persistSubscriptionLocally(subscription) {
      let subscriptionJSON = JSON.stringify(subscription);
      idb.open('web-push-db', 1).then(db => {
          let tx = db.transaction(['web-push-subcription'], 'readwrite');
          tx.objectStore('web-push-subcription').put({
              id: 1,
              data: subscriptionJSON
          });
          return tx.complete;
      });
  }
docs: Helper functions for IndexedDB management.
   
  Persists the subscription object in IndexedDB.