- Create an underlying observable
- Wrap using
withCache
- Attach an observer to the cached observable
- Send a value (A) through the underlying observable
- Unobserve from the cached observable
- Send another value (B) through the underlying
- Attach a new observer to the cached observable
- New observer receives (A) immediately, despite A being a stale value.
This issue is made worse for observers like toPromise which will unobserved after receiving their first value, meaning they only ever receive a stale value.
withCacheThis issue is made worse for observers like
toPromisewhich will unobserved after receiving their first value, meaning they only ever receive a stale value.