Update I think I might have it figured out. I was using an old bacon.js version, which might have been part of the problem. I'll update later as I figure out if I have it. Here's the partially working version: http://cdpn.io/yfxDA
I'm trying to call a function every time an element loses focus (an input
but in the below example I'm using a div
).
var $on = $('div')
$on.asEventStream('focusout').subscribe(alert('no!'))
and
var $on = $('div')
$on.asEventStream('focusout').onValue(alert('no!'))
They both work the first time but then stop working. Is there a way to get this to work?
Eventually I would like to merge focusin
/focusout
and perform a side-effect.