Skip to content

DOM response events made hot Observables always

Choose a tag to compare

@staltz staltz released this 11 Jul 08:08
· 421 commits to master since this release

With this version, responses.DOM.get(selector, eventType) will return a hot Observable, so you don't need to call .share() or .publish().refCount() on it.

In previous versions, this phenomenon caused bugs when using the Observable assuming it was hot. In fact in RxJS fromEvent() returns a hot Observable, but because of other additional operators inside Cycle Web, that hot Observable became cold, and another .publish().refCount() was needed. This now happens inside Cycle Web so you don't need to apply .publish().refCount() always. However, you do not need to migrate your code because .publish().refCount() is idempotent. We still recommend removing your .publish().refCount() calls if they exist after get(selector, eventType), but existing code will continue functioning if you upgrade to v2.1.0.