param a param b function toggle ( a , b ) { return ( target , value ) => { const options = [ target , ... value ] ; return condition => { if ( condition ) { a ( ... options ) ; } else { b ( ... options ) ; } } ; } ; } export default toggle ;