www/category-category-module-es5.js
/**
     * Atomically updates a record with the result of updateFn, which gets
     * called with the current value. If newValue is undefined, the record is
     * deleted instead.
     * @return Updated value
     */
Atomically updates a record with the result of updateFn, which gets
called with the current value. If newValue is undefined, the record is
deleted instead.
@return Updated value
Atomically updates a record with the result of updateFn which gets called with the current value . If newValue is undefined the record is deleted instead . @return Updated value
function update(appConfig, updateFn) {
      return Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__awaiter"])(this, void 0, void 0, function () {
        var key, db, tx, store, oldValue, newValue;
        return Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__generator"])(this, function (_a) {
          switch (_a.label) {
            case 0:
              key = getKey(appConfig);
              return [4
              , getDbPromise()];
            case 1:
              db = _a.sent();
              tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');
              store = tx.objectStore(OBJECT_STORE_NAME);
              return [4
              , store.get(key)];
            case 2:
              oldValue = _a.sent();
              newValue = updateFn(oldValue);
              if (!(newValue === undefined)) return [3
              , 4];
              return [4
              , store.delete(key)];
            case 3:
              _a.sent();
              return [3
              , 6];
            case 4:
              return [4
              , store.put(newValue, key)];
            case 5:
              _a.sent();
              _a.label = 6;
            case 6:
              return [4
              , tx.complete];
            case 7:
              _a.sent();
              if (newValue && (!oldValue || oldValue.fid !== newValue.fid)) {
                fidChanged(appConfig, newValue.fid);
              }
              return [2
              , newValue];
          }
        });
      });
    }
function update ( appConfig , updateFn ) { return Object ( tslib__WEBPACK_IMPORTED_MODULE_2__ [ "__awaiter" ] ) ( this , void 0 , void 0 , function ( ) { var key , db , tx , store , oldValue , newValue ; return Object ( tslib__WEBPACK_IMPORTED_MODULE_2__ [ "__generator" ] ) ( this , function ( _a ) { switch ( _a . label ) { case 0 : key = getKey ( appConfig ) ; return [ 4 , getDbPromise ( ) ] ; case 1 : db = _a . sent ( ) ; tx = db . transaction ( OBJECT_STORE_NAME , 'readwrite' ) ; store = tx . objectStore ( OBJECT_STORE_NAME ) ; return [ 4 , store . get ( key ) ] ; case 2 : oldValue = _a . sent ( ) ; newValue = updateFn ( oldValue ) ; if ( ! ( newValue === undefined ) ) return [ 3 , 4 ] ; return [ 4 , store . delete ( key ) ] ; case 3 : _a . sent ( ) ; return [ 3 , 6 ] ; case 4 : return [ 4 , store . put ( newValue , key ) ] ; case 5 : _a . sent ( ) ; _a . label = 6 ; case 6 : return [ 4 , tx . complete ] ; case 7 : _a . sent ( ) ; if ( newValue && ( ! oldValue || oldValue . fid !== newValue . fid ) ) { fidChanged ( appConfig , newValue . fid ) ; } return [ 2 , newValue ] ; } } ) ; } ) ; }
Atomically updates a record with the result of updateFn, which gets
 called with the current value.
Atomically updates a record with the result of updateFn which gets called with the current value .
/*yield*/ /*yield*/ /*break*/ /*yield*/ /*break*/ /*yield*/ /*yield*/ /*return*/