Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Re-render the modifications
this.setState({
doc: newRoot,
});
// in dev mode log the updated xml for debugging purposes
if (__DEV__) {
console.log('Updated XML:', this.serializer.serializeToString(newRoot.documentElement));
}
onEnd && onEnd();
});
if (delay) {
later(parseInt(delay, 10)).then(fetchPromise);
} else {
fetchPromise();
}
}
if (delay === 0) {
// If there's no delay, toggle immediately without showing/hiding
// any indicators.
toggleElement();
} else {
// If there's a delay, first trigger the indicators before the toggle.
const newRoot = Behaviors.setIndicatorsBeforeLoad(
showIndicatorIds,
hideIndicatorIds,
getRoot(),
);
// Update the DOM to reflect the new state of the indicators.
updateRoot(newRoot);
// Wait for the delay then toggle the target.
later(delay)
.then(toggleElement)
.catch(toggleElement);
}
},
};
if (delay === 0) {
// If there's no delay, hide target immediately without showing/hiding
// any indicators.
hideElement();
} else {
// If there's a delay, first trigger the indicators before the hide
const newRoot = Behaviors.setIndicatorsBeforeLoad(
showIndicatorIds,
hideIndicatorIds,
getRoot(),
);
// Update the DOM to reflect the new state of the indicators.
updateRoot(newRoot);
// Wait for the delay then hide the target.
later(delay)
.then(hideElement)
.catch(hideElement);
}
},
};
if (delay === 0) {
// If there's no delay, show target immediately without showing/hiding
// any indicators.
showElement();
} else {
// If there's a delay, first trigger the indicators before the show.
const newRoot = Behaviors.setIndicatorsBeforeLoad(
showIndicatorIds,
hideIndicatorIds,
getRoot(),
);
// Update the DOM to reflect the new state of the indicators.
updateRoot(newRoot);
// Wait for the delay then show the target.
later(delay)
.then(showElement)
.catch(showElement);
}
},
};