core.js
function ender(input) {
  return signal(function(next) {
    var pending = 0
    var state = null
    return spawn(input, function(item) {
      state = item === START ? (pending = pending + 1,
                                state) :
              item === END ? (pending = pending - 1,
                              pending ? state : next(item)) :
              next(item)
      return state
    })
  })
}
function ender(input) {
  return signal(function(next) {
    var pending = 0
    var state = null
    return spawn(input, function(item) {
      state = item === START ? (pending = pending + 1,
                                state) :
              item === END ? (pending = pending - 1,
                              pending ? state : next(item)) :
              next(item)
      return state
    })
  })
}
function ender ( input ) { return signal ( function ( next ) { var pending = 0 var state = null return spawn ( input , function ( item ) { state = item === START ? ( pending = pending + 1 , state ) : item === END ? ( pending = pending - 1 , pending ? state : next ( item ) ) : next ( item ) return state } ) } ) }
Takes input that represents groups wrapped in `START` and `END` items and returns input that contains all items, but `START` & `END` except the last `END`.
Takes input that represents groups wrapped in START and END items and returns input that contains all items but START & END except the last END .