flatMapLatest behaves differently from other flatMap* for synchronous Properties
milankinen opened this issue · comments
flatMapLatest
seems to change the flatMap'ed Property
to async whereas other flatMap*
series keep the property synchronous.
For example code:
const Bacon = require("baconjs") // baconjs@2.0.7
const flatMapP = Bacon.later(1, 1)
.toProperty(0)
.flatMap(x => Bacon.once(x))
const flatMapLatestP = Bacon.later(1, 1)
.toProperty(0)
.flatMapLatest(x => Bacon.once(x))
console.log(
"properties?",
flatMapP instanceof Bacon.Property,
flatMapLatestP instanceof Bacon.Property,
)
flatMapP.log("flatMap")
flatMapLatestP.log("flatMapLatest")
console.log("sync")
Produces output:
properties? true true
flatMap 0
sync
flatMap 1
flatMap <end>
flatMapLatest 0
flatMapLatest 1
flatMapLatest <end>
Which one is correct or should they actually behave differently?
Looks like a bug in .flatMapLatest
.
Fixed in 2.0.9