I noticed that the type for or() method does not match its implentation:
https://github.com/baconjs/bacon.js/blob/master/src/observable.ts#L1138
or(other: Property<any>): Property<boolean>
If the value of this is falsy, then the method returns a property with whatever is passed into or(). This means, Property<boolean> type is not correct -- the value could be anything.
const value: Property<boolean> = constant(false).or(constant('foo'))
The above code type checks, but the value actually contains a string value.
I believe the or() method's argument should be of type Property<boolean> instead of Property<any>. Alternatively, the implementation has to change to coerce the value into a boolean.
I noticed that the type for
or()method does not match its implentation:https://github.com/baconjs/bacon.js/blob/master/src/observable.ts#L1138
If the value of this is falsy, then the method returns a property with whatever is passed into
or(). This means,Property<boolean>type is not correct -- the value could be anything.The above code type checks, but the
valueactually contains a string value.I believe the
or()method's argument should be of typeProperty<boolean>instead ofProperty<any>. Alternatively, the implementation has to change to coerce the value into a boolean.