How to use fast-deep-equal - 10 common examples

To help you get started, we’ve selected a few fast-deep-equal 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 iov-one / iov-core / packages / iov-lisk / src / liskconnection.ts View on Github external
const poll = async (): Promise => {
          try {
            const event = await this.getBlockHeader(watchHeight);
            if (!equal(event, lastEvent)) {
              listener.next(event);
              ++watchHeight;
              lastEvent = event;
            }
          } catch (error) {
            if (!/^Block does not exist$/.test(error.message)) {
              listener.error(error);
            }
          }
        };
github reportportal / service-ui / app / src / components / widgets / multiLevelWidgets / cumulativeTrendChart / cumulativeTrendChart.jsx View on Github external
componentDidUpdate(prevProps) {
    if (
      !isEqual(
        prevProps.widget.contentParameters.widgetOptions.attributes,
        this.props.widget.contentParameters.widgetOptions.attributes,
      )
    ) {
      this.clearAttributes();
    }
    if (!isEqual(prevProps.widget, this.props.widget)) {
      this.getConfig();
    }
  }
github openstreetmap / iD / modules / actions / merge_remote_changes.js View on Github external
function mergeNodes(base, remote, target) {
        if (_option === 'force_local' || deepEqual(target.nodes, remote.nodes)) {
            return target;
        }
        if (_option === 'force_remote') {
            return target.update({nodes: remote.nodes});
        }

        var ccount = _conflicts.length;
        var o = base.nodes || [];
        var a = target.nodes || [];
        var b = remote.nodes || [];
        var nodes = [];
        var hunks = diff3Merge(a, o, b, true);

        for (var i = 0; i < hunks.length; i++) {
            var hunk = hunks[i];
            if (hunk.ok) {
github reportportal / service-ui / app / src / components / main / virtualPopup / popupContentWrapper / popupContentWrapper.jsx View on Github external
componentDidUpdate(prevProps) {
    if (!isEqual(prevProps.referencePosition, this.props.referencePosition)) {
      this.props.scheduleUpdate();
    }
  }
github sulu / sulu / src / Sulu / Bundle / AdminBundle / Resources / js / containers / List / List.js View on Github external
componentDidUpdate(prevProps: Props) {
        const {adapters, store} = this.props;
        if (!equal(adapters, prevProps.adapters)) {
            this.validateAdapters();
        }

        if (store !== prevProps.store) {
            store.updateLoadingStrategy(new this.currentAdapter.LoadingStrategy());
            store.updateStructureStrategy(new this.currentAdapter.StructureStrategy());
        }
    }
github storybookjs / storybook / lib / api / src / modules / layout.ts View on Github external
const updatedTheme = {
          ...theme,
          ...options.theme,
          ...checkDeprecatedThemeOptions(options),
        };

        const modification: PartialSubState = {};

        if (!deepEqual(ui, updatedUi)) {
          modification.ui = updatedUi;
        }
        if (!deepEqual(layout, updatedLayout)) {
          modification.layout = updatedLayout;
        }
        if (!deepEqual(theme, updatedTheme)) {
          modification.theme = updatedTheme;
        }
        if (options.selectedPanel && !deepEqual(selectedPanel, options.selectedPanel)) {
          modification.selectedPanel = options.selectedPanel;
        }

        if (Object.keys(modification).length) {
          store.setState(modification, { persistence: 'permanent' });
        }

        hasSetOptions = true;
      }
    },
  };
github openstreetmap / iD / modules / svg / lines.js View on Github external
.classed('retagged', function(d) {
                    return graph.entities[d.id] &&
                        base.entities[d.id] &&
                        !deepEqual(graph.entities[d.id].tags, base.entities[d.id].tags);
                })
                .call(svgTagClasses())
github sulu / sulu / src / Sulu / Bundle / AdminBundle / Resources / js / containers / List / fieldFilterTypes / SelectionFieldFilterType.js View on Github external
this.valueDisposer = autorun(() => {
            const value = toJS(this.value || []);

            if (!equals(value, untracked(() => toJS(this.selectionStore.ids)))) {
                this.selectionStore.loadItems(value);
            }

            if (!equals(value, untracked(() => this.selectValue))) {
                this.setSelectValue(value);
            }
        });
    }
github reportportal / service-ui / app / src / components / widgets / multiLevelWidgets / cumulativeTrendChart / cumulativeTrendChart.jsx View on Github external
componentDidUpdate(prevProps) {
    if (
      !isEqual(
        prevProps.widget.contentParameters.widgetOptions.attributes,
        this.props.widget.contentParameters.widgetOptions.attributes,
      )
    ) {
      this.clearAttributes();
    }
    if (!isEqual(prevProps.widget, this.props.widget)) {
      this.getConfig();
    }
  }

fast-deep-equal

Fast deep equal

MIT
Latest version published 4 years ago

Package Health Score

70 / 100
Full package analysis

Popular fast-deep-equal functions