Replies: 1 comment 1 reply
-
Any reason you're still using selectIsRequestCached and not https://ngneat.github.io/elf/docs/features/requests-result? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm currently trying to introduce elf cache mechanism with TTL and wondering why the cache status is not set to 'none' after the TTL period. I need to implement a periodically update of values after the TTL is expired. In my opinion the cache status after expiration should be set to 'none' and with
const isCached$ = store.pipe(selectIsRequestCached('todos'
I can trigger an update of the values.I think the best way to focus our problem is with an example.
First, we define the store with the following code:
Next, we define the data that we want to save:
Since we don't want to wait too long to see the result, we define the ttl with a value of 10 seconds:
private readonly TTL = 10000;
Next we update the data in the store
In order to see the changes in the state, we print it to the console:
As you can see, the data is stored correctly in the store:
but the defined ttl does not have the expected effect:
Can someone help me or tell me if this behavior could be a bug?
Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions