Replies: 1 comment
-
Meanwhile I come up with this simple solution: const tracked$ = store.pipe(selectAllEntities(), joinRequestResult(['key'])
const lastUpdate$ = tracked$.pipe(
pairwise(),
filter(
([{ fetchStatus: previous }, { fetchStatus: current }]) =>
previous === 'fetching' && current === 'idle',
),
map(() => new Date()),
shareReplay(1),
); FYI I had to add shareReplay(1) for subscribers that subscribed after the first transition from 'fetching' to 'idle' happened. There might be other edge cases but it worked for mine. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It might be useful to get and store the latest timestamp when using
trackRequestResult
andjoinRequestResult
.Beta Was this translation helpful? Give feedback.
All reactions