Network cache with limit #109
Unanswered
swbtrifork
asked this question in
Q&A
Replies: 1 comment 5 replies
-
Sure, you can pass any key you want: export function setTodos(todos: Todo[], limit) {
store.update(
updateRequestCache(`limit=${limit}`),
setEntities(todos)
);
}
export function fetchTodos(limit) {
return http.get(todosUrl).pipe(
tap(setTodos(todos, limit)),
skipWhileTodosCached(`limit=${limit}`)
);
} |
Beta Was this translation helpful? Give feedback.
5 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.
-
Is there any way you can cache requests with a limit? Lets say i want to switch between 5 or 10 as in
https://jsonplaceholder.typicode.com/todos?_limit=${limit}
, where the limit should only refetch if it has not been called yet?Beta Was this translation helpful? Give feedback.
All reactions