dist/js/idbhelper.js
/**
   * toggle and update favorite in idb by id
   */
toggle and update favorite in idb by id
toggle and update favorite in idb by id
static idbToggleFavorite(id, condition) {
    IDBHelper.dbPromise.then(async db => {
      const tx = db.transaction('restaurants', 'readwrite');
      const store = tx.objectStore('restaurants');
      let val = (await store.get(id)) || 0;
      val.is_favorite = String(condition);
      store.put(val, id);
      return tx.complete;
    });
  }
static idbToggleFavorite ( id , condition ) { IDBHelper . dbPromise . then ( async db => { const tx = db . transaction ( 'restaurants' , 'readwrite' ) ; const store = tx . objectStore ( 'restaurants' ) ; let val = ( await store . get ( id ) ) || 0 ; val . is_favorite = String ( condition ) ; store . put ( val , id ) ; return tx . complete ; } ) ; }
toggle and update favorite in idb by id
toggle and update favorite in idb by id