bacon.js implementation