cluedin-widget
Version:
This project contains all the pages needed for browsing entities and searching them. The aim is to replace the CluedIn.Webapp project with this one when all the pages ( including the Admin page ) will be ported to REACT.
17 lines (13 loc) • 537 B
JavaScript
;
import warning from 'warning';
function runTransitionHook(hook, location, callback) {
var result = hook(location, callback);
if (hook.length < 2) {
// Assume the hook runs synchronously and automatically
// call the callback with the return value.
callback(result);
} else {
process.env.NODE_ENV !== 'production' ? warning(result === undefined, 'You should not "return" in a transition hook with a callback argument; call the callback instead') : undefined;
}
}
export default runTransitionHook;