a -> b -> c1 -> d -> x
-> c2 ---^
-> c3 ---^
let graph = [
{ name: 'a', next: 'b'},
{ name: 'b', next: function(){return 'c1'}},
{ name: 'c1', next: 'd'},
{ name: 'c2', next: 'd'},
{ name: 'c3', next: 'd'},
{ name: 'd', next: 'x'},
{ name: 'x', next: null}
];
let config = {
start: 'a',
name: 'name',
next: 'next'
};
let route = routeHandler(graph, config);
// or
let route = routeHandler(graph, 'a');