Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
}
};
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();
}
}
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) {
componentDidUpdate(prevProps) {
if (!isEqual(prevProps.referencePosition, this.props.referencePosition)) {
this.props.scheduleUpdate();
}
}
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());
}
}
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;
}
},
};
.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())
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);
}
});
}
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();
}
}