How to use the lodash.isEqual function in lodash

To help you get started, we’ve selected a few lodash examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ballerina-attic / composer / modules / web / js / ballerina / views / struct-variable-definition-view.js View on Github external
}).keydown(function(e){
            var enteredKey = e.which || e.charCode || e.keyCode;

            // If tab pressed.
            if (e.shiftKey && _.isEqual(enteredKey, 9)) {
                typeDropdown.dropdownButton.trigger("click");
            }
        }).keyup(function(){
            self.getModel().setName($(this).val());
github dmapper / react-sharedb / src / old.js View on Github external
// Clone before writing
            newValues[key] = _.cloneDeep(value)
            update = true
          }
          // Handle normal query (sets array of documents and array of ids)
        } else {
          let ids = []
          let value = query.get().filter(doc => {
            if (doc) {
              ids.push(doc.id)
              return true
            } else {
              return false
            }
          })
          if (!_.isEqual(value, this.state[key])) {
            // Clone before writing
            newValues[key] = _.cloneDeep(value)
            update = true
          }
          let idsName = getIdsName(key)
          if (!_.isEqual(ids, this.state[idsName])) {
            newValues[idsName] = ids
            update = true
          }
        }
        if (update) this.setState(newValues)
      }
github Graylog2 / graylog2-server / enterprise / src / web / enterprise / stores / SelectedFieldsStore.js View on Github external
onViewStoreChange(newState: StateUpdate) {
    const selectedFields = Set(get(newState, 'state.fields'));
    if (!isEqual(this.selectedFields, selectedFields)) {
      this.selectedFields = selectedFields;
      this._trigger();
    }
  },
github i-novus-llc / n2o-framework / frontend / n2o-framework / src / components / widgets / WidgetContainer.jsx View on Github external
componentDidMount() {
        const {
          fetchOnInit,
          visible,
          dataProviderFromState,
          dataProvider,
        } = this.props;
        if (
          fetchOnInit &&
          visible &&
          isEqual(dataProvider, dataProviderFromState)
        ) {
          this.onFetch();
        }
      }
github chrisgreg / react-delayed-list / src / DelayedList.js View on Github external
shouldComponentUpdate(nextProps, nextState) {
    if (!isEqual(this.props.children, nextProps.children)) {
      this.setData(nextProps.children);
      return true;
    } else if (!isEqual(this.state.items, nextState.items)) {
      return true;
    } else {
      return false;
    }
  }
github SonarSource / sonarqube / server / sonar-web / src / main / js / components / charts / AdvancedTimeline.tsx View on Github external
if (
      nextProps.metricType !== this.props.metricType ||
      nextProps.startDate !== this.props.startDate ||
      nextProps.endDate !== this.props.endDate ||
      nextProps.width !== this.props.width ||
      nextProps.padding !== this.props.padding ||
      nextProps.height !== this.props.height ||
      nextProps.series !== this.props.series
    ) {
      scales = this.getScales(nextProps);
      if (this.state.selectedDate != null) {
        selectedDatePos = this.getSelectedDatePos(scales.xScale, this.state.selectedDate);
      }
    }

    if (!isEqual(nextProps.selectedDate, this.props.selectedDate)) {
      const xScale = scales ? scales.xScale : this.state.xScale;
      selectedDatePos = this.getSelectedDatePos(xScale, nextProps.selectedDate);
    }

    if (scales || selectedDatePos) {
      if (scales) {
        this.setState({ ...scales });
      }
      if (selectedDatePos) {
        this.setState({ ...selectedDatePos });
      }

      if (selectedDatePos && nextProps.updateTooltip) {
        nextProps.updateTooltip(
          selectedDatePos.selectedDate,
          selectedDatePos.selectedDateXPos,
github dtysky / MoeNotes / src / cores / utils.js View on Github external
export function arrayAreSimilar(a1, a2){
    let a1_tmp = deepcopy(a1).sort();
    let a2_tmp = deepcopy(a2).sort();
    return lodash.isEqual(a1_tmp, a2_tmp);
}
github Lattice-Automation / seqviz / src / SeqViz / SeqViz.jsx View on Github external
search = (part = null) => {
    const {
      onSearch,
      search: { query, mismatch },
      seq
    } = this.props;

    if (!(seq || (part && part.seq))) {
      return;
    }

    const { results } = search(query, mismatch, seq || part.seq);
    if (isEqual(results, this.state.search)) {
      return;
    }

    this.setState({ search: results });
    onSearch(results);
  };
github Mockgoose / Mockgoose / lib / utils.js View on Github external
function matchValues(item, value) {
    if(valuesAreObjectIds(item, value)){
        return item.equals(value);
    }
    return _.isEqual(item, value);
}