save modified state
@param onDoneCallback    function to call on save complete
@return {*}
174889
function saveBoxed(onDoneCallback = UNDEFINED) {
    const boxed = this.boxed;
    if (boxed) {
        const modified = boxed[boxedImmutable.BOXED_GET_THIS].valueOfModified();
        if (modified !== UNDEFINED) {
            this.boxed = UNDEFINED;
            if (this.saveState) {
                return this.saveState(modified, boxed, onDoneCallback);
            } else {
                throw new TypeError("Save State Not Supported on this instance, saveState callback not provided");
            }
        }
    } else if (onDoneCallback) {
        onDoneCallback();
    }
}
105174
public Object saveState(FacesContext context) {

        if (context == null) {
            throw new NullPointerException();
        }
        
        // If initial state has been marked, we don't need to
        // save any state.
        if (initialStateMarked()) {
            return null;
        }

        // At the moment, the only state we need to save is our listeners
        return UIComponentBase.saveAttachedState(context, listeners);
    }
627730
def save(self):
        
        if self.instance is None:
            raise CQLEngineException("DML Query intance attribute is None")
        assert type(self.instance) == self.model

        nulled_fields = set()
        if self.instance._has_counter or self.instance._can_update():
            if self.instance._has_counter:
                warn("'create' and 'save' actions on Counters are deprecated. It will be disallowed in 4.0. "
                    "Use the 'update' mechanism instead.", DeprecationWarning)
            return self.update()
        else:
            insert = InsertStatement(self.column_family_name, ttl=self._ttl, timestamp=self._timestamp, if_not_exists=self._if_not_exists)
            static_save_only = False if len(self.instance._clustering_keys) == 0 else True
            for name, col in self.instance._clustering_keys.items():
                static_save_only = static_save_only and col._val_is_null(getattr(self.instance, name, None))
            for name, col in self.instance._columns.items():
                if static_save_only and not col.static and not col.partition_key:
                    continue
                val = getattr(self.instance, name, None)
                if col._val_is_null(val):
                    if self.instance._values[name].changed:
                        nulled_fields.add(col.db_field_name)
                    continue
                if col.has_default and not self.instance._values[name].changed:
                    # Ensure default columns included in a save() are marked as explicit, to get them *persisted* properly
                    self.instance._values[name].explicit = True
                insert.add_assignment(col, getattr(self.instance, name, None))

        # skip query execution if it's empty
        # caused by pointless update queries
        if not insert.is_empty:
            self._execute(insert)
        # delete any nulled columns
        if not static_save_only:
            self._delete_null_columns()
415508
function doSave(titleStr) {
    var storeRef = this.props.storeRef;
    var tabliFolderId = storeRef.getValue().folderId;
    actions.manageWindow(tabliFolderId, this.state.saveTabWindow, titleStr, (0, _oneref.refUpdater)(storeRef));
    this.closeSaveModal();
  }
260016
public void checkReloadState(final AsyncCallback<Boolean> callback) {

        // :read-attribute(name=process-type)
        final ModelNode operation = new ModelNode();
        operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
        operation.get(NAME).set("server-state");
        operation.get(ADDRESS).setEmptyList();

        dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {

            @Override
            public void onSuccess(DMRResponse result) {

                ModelNode response = result.get();
                System.out.println(response);

                if(response.isFailure()) {
                    callback.onFailure(new RuntimeException("Failed to poll server state"));
                }
                else
                {
                    // TODO: only works when this response changes the reload state
                    String outcome = response.get(RESULT).asString();
                    boolean keepRunning = !outcome.equalsIgnoreCase("running");//reloadState.isStaleModel();

                    if(!keepRunning)
                    {

                        // clear state
                        reloadState.reset();

                        Console.info(Console.MESSAGES.successful("Reload Server"));
                        getView().setReloadRequired(reloadState);
                        getEventBus().fireEvent(new ReloadEvent());
                    }

                    callback.onSuccess(keepRunning);
                }
            }
        });
    }
663160
def save(self, to_save, manipulate=True, check_keys=True, **kwargs):
        
        warnings.warn("save is deprecated. Use insert_one or replace_one "
                      "instead", DeprecationWarning, stacklevel=2)
        common.validate_is_document_type("to_save", to_save)

        write_concern = None
        collation = validate_collation_or_none(kwargs.pop('collation', None))
        if kwargs:
            write_concern = WriteConcern(**kwargs)

        with self._socket_for_writes() as sock_info:
            if not (isinstance(to_save, RawBSONDocument) or "_id" in to_save):
                return self._insert(sock_info, to_save, True,
                                    check_keys, manipulate, write_concern)
            else:
                self._update(sock_info, {"_id": to_save["_id"]}, to_save, True,
                             check_keys, False, manipulate, write_concern,
                             collation=collation)
                return to_save.get("_id")
1191746
function() {
    const changed_keys = store._changed_keys
    if (changed_keys.length === 0) {
      console.error('no keys were changed, yet we are trying to publish a store change')
      return
    }

    // make sure _changed_keys is reset before executing callbacks
    // (if callbacks modify state, the list of keys the callback changed would be wiped out)
    store._changed_keys = []
    store._clearDebounceTimeout()
    store._callback_objs.forEach(obj => obj.callback(changed_keys))
  }
27499
function () {
            var self = this;
            if (this._dirty) {
                self._dirty = false;
                return this.storage.save(this.data);
            } else {
                return (new $.Deferred()).resolve().promise();
            }
        }
1144090
function stateUpdateParamsSurrogate(state, toParams) {
            var oldOnEnter = state.self.onEnter;
            state.self.onEnter = function () {
              _StickyState.stateEntering(state, toParams, oldOnEnter, true);
            };
            restore.addRestoreFunction(function () {
              state.self.onEnter = oldOnEnter;
            });

            return state;
          }
15756
function processAfterStateChange(el) {
    const optionValue = el.dataset.optionValue;
    const optionIndex = Array.prototype.slice.call(el.parentNode.children).indexOf(el);
    this.setSelectedOption(optionValue);
    elementScroll.scroll(el);
    emitAndFire(this, 'listbox-change', {
        index: optionIndex,
        selected: [optionValue],
        el
    });
}
565533
function sendReload() {
  if (saveChecksum) {
    $.ajax({
      url: jsbin.getURL() + '/reload',
      data: {
        code: jsbin.state.code,
        revision: jsbin.state.revision,
        checksum: saveChecksum
      },
      type: 'post'
    });
  }
}
203478
function buildAsyncSaveFun(_this, _oldSave, _promise, _oldPromise) {
    return function() {

      // swap promises so save behaves like it has been called during the original call.
      var currentPromise = _this.$promise;
      _this.$promise = _oldPromise;

      // when save resolves, the timeout promise is resolved and the last resource promise returned
      // so it behaves
      _oldSave.call(_this).$promise.then(
        function(_data) {
          _promise.resolve(_data);
          _this.$promise = currentPromise;
        }, function(_reason) {
          _promise.reject(_reason);
          _this.$promise = currentPromise;
        }
      );

      _this.$dmStatus = null;
    };
  }
49201
function(key, value, callback) {
        if (this.get(key) == value) {
            return;
        }

        this.set(key, value);
        clearTimeout(this._saveTimeout);
        this._saveTimeout = setTimeout(_.bind(function() {
            fs.writeFile(this._stateFile, JSON.stringify(this.attributes, null, '\t'), _.bind(function() {
                logger.info(key + ' saved to ' + path.join(process.cwd(), this._stateFile));
                while (this._callbacks && this._callbacks.length) {
                    this._callbacks.shift()();
                }
            }, this));
        }, this), 1000);

        if (callback) {
            if (!this._callbacks) {
                this._callbacks = [];
            }

            this._callbacks.push(callback);
        }
    }
1022756
function rollback(client, done, error, callback) {
  client.query('ROLLBACK', rollbackError => {
    done(rollbackError);
    return callback(rollbackError || error, null);
  });
}
1262053
function saveTransformedData(uri) {
  return function (data) {
    return db.put(uri, JSON.stringify(data))
      .then(function () {
        // If the Promise resolves it means we saved,
        // so let's return the data
        return data;
      });
  };
}
1138662
@Override
    public Object saveState(FacesContext context) {
        if (context == null) {
            throw new NullPointerException();
        }

        Object[] result = null;
        
        Object superState = super.saveState(context);
        Object validatorsState = ((validators != null) ? validators.saveState(context) : null);
        
        if (superState != null || validatorsState != null) {
            result = new Object[] { superState, validatorsState};
        }
        
        return (result);
    }
323412
function () {
            var result = new $.Deferred();
            this.storage.load()
                .then(function (data) {
                    var oldKeys = this.getKeys();
                    this.data = data;
                    result.resolve();
                    this.trigger(PREFERENCE_CHANGE, {
                        ids: _.union(this.getKeys(), oldKeys)
                    });
                }.bind(this))
                .fail(function (error) {
                    result.reject(error);
                });
            return result.promise();
        }