How to use the lodash-es.isEqual function in lodash-es

To help you get started, we’ve selected a few lodash-es 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 openshift / console / frontend / public / components / app.jsx View on Github external
componentDidUpdate(prevProps) {
    const props = this.props;
    // Prevent infinite loop in case React Router decides to destroy & recreate the component (changing key)
    const oldLocation = _.omit(prevProps.location, ['key']);
    const newLocation = _.omit(props.location, ['key']);
    if (_.isEqual(newLocation, oldLocation) && _.isEqual(props.match, prevProps.match)) {
      return;
    }
    // two way data binding :-/
    const { pathname } = props.location;
    store.dispatch(UIActions.setCurrentLocation(pathname));
  }
github openshift / console / frontend / public / components / graphs / status.jsx View on Github external
componentWillReceiveProps(nextProps) {
    if (_.isEqual(nextProps, this.props)) {
      return;
    }
    this.clock += 1;
    // Don't show stale data if we changed the query.
    this.setState({
      status: '...',
      short: undefined,
      long: undefined,
    });
    this.fetch(nextProps);
  }
github openshift / console / frontend / public / components / overview / index.tsx View on Github external
services,
      statefulSets,
      selectedGroup,
    } = this.props;

    if (namespace !== prevProps.namespace
      || loaded !== prevProps.loaded
      || !_.isEqual(buildConfigs, prevProps.buildConfigs)
      || !_.isEqual(builds, prevProps.builds)
      || !_.isEqual(daemonSets, prevProps.daemonSets)
      || !_.isEqual(deploymentConfigs, prevProps.deploymentConfigs)
      || !_.isEqual(deployments, prevProps.deployments)
      || !_.isEqual(pods, prevProps.pods)
      || !_.isEqual(replicaSets, prevProps.replicaSets)
      || !_.isEqual(replicationControllers, prevProps.replicationControllers)
      || !_.isEqual(routes, prevProps.routes)
      || !_.isEqual(services, prevProps.services)
      || !_.isEqual(statefulSets, prevProps.statefulSets)) {
      this.createOverviewData();
    } else if (filterValue !== prevProps.filterValue) {
      const filteredItems = this.filterItems(this.state.items);
      this.setState({
        filteredItems,
        groupedItems: groupItems(filteredItems, selectedGroup),
      });
    } else if (selectedGroup !== prevProps.selectedGroup) {
      this.setState({
        groupedItems: groupItems(this.state.filteredItems, selectedGroup),
      });
    }

    // Fetch new metrics when the namespace changes.
github brandingbrand / flagship / packages / fsproductindex / src / components / ProductIndexProvider.tsx View on Github external
componentDidUpdate(prevProps: ResultProps): void {
        if (!isEqual(this.props.commerceData, prevProps.commerceData)) {
          if (!this.props.disableReviews) {
            this.requestReviews().catch(err => console.warn('Could not get reviews', err));
          }

          if (this.props.onReceiveCommerceData && this.state.commerceData) {
            this.props.onReceiveCommerceData(this.state.commerceData);
          }
        }
      }
github openshift / console / frontend / public / components / overview / index.tsx View on Github external
replicationControllers,
      routes,
      services,
      statefulSets,
      selectedGroup,
    } = this.props;

    if (namespace !== prevProps.namespace
      || loaded !== prevProps.loaded
      || !_.isEqual(buildConfigs, prevProps.buildConfigs)
      || !_.isEqual(builds, prevProps.builds)
      || !_.isEqual(daemonSets, prevProps.daemonSets)
      || !_.isEqual(deploymentConfigs, prevProps.deploymentConfigs)
      || !_.isEqual(deployments, prevProps.deployments)
      || !_.isEqual(pods, prevProps.pods)
      || !_.isEqual(replicaSets, prevProps.replicaSets)
      || !_.isEqual(replicationControllers, prevProps.replicationControllers)
      || !_.isEqual(routes, prevProps.routes)
      || !_.isEqual(services, prevProps.services)
      || !_.isEqual(statefulSets, prevProps.statefulSets)) {
      this.createOverviewData();
    } else if (filterValue !== prevProps.filterValue) {
      const filteredItems = this.filterItems(this.state.items);
      this.setState({
        filteredItems,
        groupedItems: groupItems(filteredItems, selectedGroup),
      });
    } else if (selectedGroup !== prevProps.selectedGroup) {
      this.setState({
        groupedItems: groupItems(this.state.filteredItems, selectedGroup),
      });
    }
github openshift / console / frontend / public / components / operator-lifecycle-manager / create-operand.tsx View on Github external
      .filter(f => f.required || !_.isEqual(formValues[f.path], defaultValueFor(f)))
      .reduce((allErrors, field) => {
github virtool / virtool / client / src / js / account / components / API / Key.js View on Github external
onPermissionChange = (key, value) => {
        const permissions = { ...this.state.permissions, [key]: value };

        this.setState({
            changed: !isEqual(permissions, this.props.apiKey.permissions),
            permissions
        });
    };
github openshift / console / frontend / public / components / utils / value-from-pair.jsx View on Github external
_.each(configMaps.items, (v) => {
    cmItems[`${v.metadata.name}:${cmRefProperty}`] = (
      
    );
    if (kind === 'ConfigMap' && _.isEqual(v.metadata.name, name)) {
      refProperty = cmRefProperty;
      itemKeys = getKeys(v.data);
    }
  });
  _.each(secrets.items, (v) => {
github ealgis / ealgis / frontend / src / map-ui / legend-peek-bar-swatch / LegendPeekBarSwatchContainer.tsx View on Github external
shouldComponentUpdate(nextProps: IProps) {
        const { styleDef } = this.props
        return !isEqual(styleDef, nextProps.styleDef)
    }
github openshift / console / frontend / public / components / overview / index.tsx View on Github external
deploymentConfigs,
      filterValue,
      loaded,
      namespace,
      pods,
      replicaSets,
      replicationControllers,
      routes,
      services,
      statefulSets,
      selectedGroup,
    } = this.props;

    if (namespace !== prevProps.namespace
      || loaded !== prevProps.loaded
      || !_.isEqual(buildConfigs, prevProps.buildConfigs)
      || !_.isEqual(builds, prevProps.builds)
      || !_.isEqual(daemonSets, prevProps.daemonSets)
      || !_.isEqual(deploymentConfigs, prevProps.deploymentConfigs)
      || !_.isEqual(deployments, prevProps.deployments)
      || !_.isEqual(pods, prevProps.pods)
      || !_.isEqual(replicaSets, prevProps.replicaSets)
      || !_.isEqual(replicationControllers, prevProps.replicationControllers)
      || !_.isEqual(routes, prevProps.routes)
      || !_.isEqual(services, prevProps.services)
      || !_.isEqual(statefulSets, prevProps.statefulSets)) {
      this.createOverviewData();
    } else if (filterValue !== prevProps.filterValue) {
      const filteredItems = this.filterItems(this.state.items);
      this.setState({
        filteredItems,
        groupedItems: groupItems(filteredItems, selectedGroup),