called whenever we change a list. normally this would mean a database API call
973068
function(list){
            localStorage.setItem(localStorageKey, JSON.stringify(list));
            // if we used a real database, we would likely do the below in a callback
            this.list = list;
            this.trigger(list); // sends the updated list to all listening components (TodoApp)
        }
1235896
def _on_selection(self):
        
        if self.value and os.path.isdir(self.value):
            self._populate_list(self.value)
        elif self._external_notification:
            self._external_notification()
1113521
function onchange(array, index, removed, added) {
		edb.Array.$onchange(array, index, removed, added);
	}
371673
@Override
  public void replace(List list, String resourceVersion) {
    lock.writeLock().lock();
    try {
      Set<String> keys = new HashSet<>();
      for (Object obj : list) {
        String key = this.keyOf(obj);
        keys.add(key);
        this.queueActionLocked(DeltaType.Sync, obj);
      }

      if (this.knownObjects == null) {
        for (Map.Entry<String, Deque<MutablePair<DeltaType, Object>>> entry :
            this.items.entrySet()) {
          if (keys.contains(entry.getKey())) {
            continue;
          }

          Object deletedObj = null;
          MutablePair<DeltaType, Object> delta = entry.getValue().peekLast(); // get newest
          if (delta != null) {
            deletedObj = delta.getRight();
          }
          this.queueActionLocked(
              DeltaType.Deleted, new DeletedFinalStateUnknown(entry.getKey(), deletedObj));
        }

        if (!this.populated) {
          this.populated = true;
          this.initialPopulationCount = list.size();
        }
        return;
      }

      // Detect deletions not already in the queue.
      List<String> knownKeys = this.knownObjects.listKeys();
      int queueDeletion = 0;
      for (String knownKey : knownKeys) {
        if (keys.contains(knownKey)) {
          continue;
        }

        Object deletedObj = this.knownObjects.getByKey(knownKey);
        if (deletedObj == null) {
          log.warn(
              "Key {} does not exist in known objects store, placing DeleteFinalStateUnknown marker without object",
              knownKey);
        }
        queueDeletion++;
        this.queueActionLocked(
            DeltaType.Deleted, new DeletedFinalStateUnknown<>(knownKey, deletedObj));
      }

      if (!this.populated) {
        this.populated = true;
        this.initialPopulationCount = list.size() + queueDeletion;
      }
    } finally {
      lock.writeLock().unlock();
    }
  }
589686
def _list_selection_changed(self):
        """"""
        items = self.list_layers_in_map_report.selectedItems()
        self.remove_layer.setEnabled(len(items) >= 1)
        if len(items) == 1 and self.list_layers_in_map_report.count() >= 2:
            index = self.list_layers_in_map_report.indexFromItem(items[0])
            index = index.row()
            if index == 0:
                self.move_up.setEnabled(False)
                self.move_down.setEnabled(True)
            elif index == self.list_layers_in_map_report.count() - 1:
                self.move_up.setEnabled(True)
                self.move_down.setEnabled(False)
            else:
                self.move_up.setEnabled(True)
                self.move_down.setEnabled(True)
        else:
            self.move_up.setEnabled(False)
            self.move_down.setEnabled(False)
473861
def changelist_view(self, request, extra_context=None):
        """"""
        if extra_context is None:
            extra_context = {}
        response = self.adv_filters_handle(request,
                                           extra_context=extra_context)
        if response:
            return response
        return super(AdminAdvancedFiltersMixin, self
                     ).changelist_view(request, extra_context=extra_context)
897833
function collection() {
  var source = [];
  var api = {
    length: 0,

    push: function (item) {
      source.push(item);
      this.length += 1;

      api.fire('changed', { added: [item] });
    },

    splice: function (idx, count) {
      var removed = source.splice(idx, count);
      this.length = source.length;
      api.fire('changed', { removed: removed, removeIdx: idx });
    },

    get : function (idx) {
      return source[idx];
    },

    forEach: function (callback, thisArg) {
      source.forEach(callback, thisArg);
    }
  };

  eventify(api);

  return api;
}
1249634
protected function handleListifyScopeChange()
    {
        if ( ! $this->hasListifyScopeChanged()) return;

        $this->rememberCurrentlyUsedScope();

        // swap the attributes so the record is scoped in its old scope
        $this->swapChangedAttributes();

        if ( ! $this->excludeFromList() && $this->lowerItem()) {
            $this->decrementPositionsOfItemsBelow();
        }

        // swap the attributes back, so the item can be positioned in its new scope
        $this->swapChangedAttributes();

        // unset its position, so it will get the correct new position in its new scope
        $this->setListifyPosition(null);

        $this->performConfiguredAddMethod($this);
    }
799726
void onDataSetSelected() {
        String selectedUUID = view.getSelectedDataSetId();
        for (DataSetDef dataSetDef : _dataSetDefList) {
            if (dataSetDef.getUUID().equals(selectedUUID)) {
                fetchMetadata(selectedUUID,
                              new RemoteCallback<DataSetMetadata>() {

                                  public void callback(DataSetMetadata metadata) {
                                      dataSetLookup = lookupConstraints.newDataSetLookup(metadata);
                                      updateDataSetLookup();
                                      changeEvent.fire(new DataSetLookupChangedEvent(dataSetLookup));
                                  }
                              });
            }
        }
    }
740440
def perform_actions(change_list,comment=nil)
      xml_str = gen_change_xml(change_list,comment)
      @conn.request(@conn.base_url + @host_url+"/rrset","POST",xml_str)
    end
277286
public final void change() {
        final ApiAttribute chanAttr = new ApiAttribute("attribute", "Changed");
        chanAttr.getAttributes().add(new DateUtil().todayDateAttribute());
        final ArrayList<ApiAttribute> chanList = new ArrayList<>();
        chanList.add(chanAttr);
        this.changed.clear();
        this.changed.addAll(chanList);
    }
569481
public boolean selectionChanged(Object source, int iStartRow, int iEndRow, int iSelectType)
    {
        boolean bChanged = super.selectionChanged(source, iStartRow, iEndRow, iSelectType);
        if (bChanged)
        { // Notify all the listSelectionListeners
            this.fireMySelectionChanged(new MyListSelectionEvent(source, this, m_iSelectedRow, iSelectType));
        }
        return bChanged;
    }
26038
def on_change(self, path, event_type):
        
        # I can do all this work in a sql statement, but
        # for debugging it's easier to do it in stages.
        sql = """SELECT collection_id
                 FROM collection_table
                 WHERE path == ?
        """
        cursor = self._execute(sql, (path,))
        results = cursor.fetchall()
        # there should always be exactly one result, but
        # there's no harm in using a loop to process the
        # single result
        for result in results:
            collection_id = result[0]
            # remove all keywords in this collection
            sql = """DELETE from keyword_table
                     WHERE collection_id == ?
            """
            cursor = self._execute(sql, (collection_id,))
            self._load_keywords(collection_id, path=path)
656459
def changed(requestContext, seriesList):
    
    for series in seriesList:
        series.name = series.pathExpression = 'changed(%s)' % series.name
        previous = None
        for index, value in enumerate(series):
            if previous is None:
                series[index] = 0
            elif value is not None and previous != value:
                series[index] = 1
            else:
                series[index] = 0
            previous = value
    return seriesList
577562
@Override
    protected void onRangeChanged(HasData<RecordList.Record> display) {
        // Get the new range required.
        range = display.getVisibleRange();
        updateResults(range.getStart(), range.getLength());
    }
666934
public void diffUpdate(List<T> newList) {
    if (getCollection().size() == 0) {
      addAll(newList);
      notifyDataSetChanged();
    } else {
      DiffCallback diffCallback = new DiffCallback(collection, newList);
      DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(diffCallback);
      clear();
      addAll(newList);
      diffResult.dispatchUpdatesTo(this);
    }
  }
51340
public void setList(List<T> list) {
        if (list != mList) {
            mList = list;
            if (mList == null) {
                notifyInvalidated();
            } else {
                notifyChanged();
            }
        }
    }