It looks like I just needed the most up to date version of the software. Here's what the code looks like now:
var $on = $('div')
var $h = $('div input')
var d = 'contains'
$h.val(d)
var f = function(arg){
return ($h.val() === d) ? '' : d
}
$on.asEventStream('focusout').merge($on.asEventStream('focusin')).toProperty().assign($h, 'val', f)