Closed 1ven closed 7 years ago
Hey @1ven. The initial value is a required parameter. The convention in the docs is that unless a parameter is explicitly called out as optional, it's required. Perhaps it's a bit more obvious in scan
's type definition, though.
So, as things go in JS, by not passing a value, you're implicitly passing undefined
, and scan
always produces it's initial value as its first event.
Sorry for any confusion. Hope that helps.
Hi, now it's clear, thanks for clarification :)
Great, glad that helped.
The problem is solved by using .skip(1)
method
Summary
When running
scan
without initial value, it emitsundefined
as a first value. Or it's correct behaviour and I'm understanding it wrong?Expected result
It should not emit
undefined
when no initial value provided.Versions
1.5.0
Code to reproduce