baconjs / bacon.js

Functional reactive programming library for TypeScript and JavaScript

Home Page:https://baconjs.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

takeWhile(property) is not subscribing to that property

miracle2k opened this issue · comments

Bacon/FRP noob here, but I wonder if this isn't a bug. I use this code:

stream.log('want to return').takeWhile(hasSubscriptions).log('actually returning');

Turns out this does't work as expected, as the values never manage to go through takeWhile.

On the other hand, this work as expected:

hasSubscriptions.log();
stream.log('want to return').takeWhile(hasSubscriptions).log('actually returning');

(hasSubscriptions is a property created with .scan()).

Shoulnd't takeWhile cause a subscription to the property?

I am using 0.7.83.