tsdms
Version: 
Time Series Data Management System
24 lines (17 loc) • 775 B
JavaScript
;
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _warning = require('warning');
var _warning2 = _interopRequireDefault(_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' ? _warning2['default'](result === undefined, 'You should not "return" in a transition hook with a callback argument; call the callback instead') : undefined;
  }
}
exports['default'] = runTransitionHook;
module.exports = exports['default'];