I currently developing a third party widget for online publishers and would like to track its performance on different websites. I thought of implementing Upworthy's code (http://upworthy.github.io/2014/06/implementing-attention-minutes-part-1/) for calculating average time spent per user on my widget only. So I decided to implement it in 3 steps:
I have implemented the above and source code can be found here: http://jsfiddle.net/q21gzjmf/13/
However, if you scroll down at the bottom you will find that time spent is calculated as 0 and doesn't update itself dynamically unlike Upworthy's implementation shown here http://jsfiddle.net/zanes/mbGBr/. I'm very new to the concept of Functional Reactive programming and still trying to get my head around Bacon.JS so I'm sure I must have made a very silly, conceptual mistake but I'm here to learn. Any help will be greatly appreciated.