(routes, fn)
| 1 | export const createRoute = (routes, fn) => ({ root, props, actions = [], timestamp, shouldOptimize }) => { |
| 2 | actions.filter(action => routes[action.type]) |
| 3 | .forEach(action => |
| 4 | routes[action.type]({ root, props, action: action.data, timestamp, shouldOptimize }) |
| 5 | ); |
| 6 | if (fn) { |
| 7 | fn({ root, props, actions, timestamp, shouldOptimize }); |
| 8 | }; |
| 9 | }; |
no test coverage detected