UNPKG

react-toolbox-reactrouter-mocha-boilerplate

Version:

### Getting Started 1. Clone this repository 2. Run `npm install && npm start` 3. Visit `0.0.0.0:8080` in your browser

19 lines (15 loc) 486 B
import warning from 'warning' function runTransitionHook(hook, location, callback) { const 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 { warning( result === undefined, 'You should not "return" in a transition hook with a callback argument; call the callback instead' ) } } export default runTransitionHook