UNPKG

@hyperapp/router

Version:

Declarative routing for Hyperapp V1 using the History API.

13 lines (12 loc) 245 B
export function Switch(props, children) { return function(state, actions) { var child, i = 0 while ( !(child = children[i] && children[i](state, actions)) && i < children.length ) i++ return child } }