EffectFn + DataSource #352
Answered
by
NetanelBasal
OmerGronich
asked this question in
Q&A
-
I'm playing around with elf in angular trying to figure out the mental model. In the following stackblitz example, there's a list of todos and a button that calls the getTodos side effect to refetch the todos. When clicking the refetch button, the todos do indeed refetch, but the dataSource.loading state does not update. What am I missing? https://stackblitz.com/edit/angular-ivy-2mllw2?file=src/app/todos.repository.ts thanks in advance! |
Beta Was this translation helpful? Give feedback.
Answered by
NetanelBasal
Oct 11, 2022
Replies: 1 comment 1 reply
-
It needs to be added to the HTTP request: getTodos = this.createEffectFn(($: Observable<void>) =>
$.pipe(
mergeMap(() =>
this.http
.get('https://jsonplaceholder.typicode.com/todos')
.pipe(trackRequestStatus())
),
tap(setTodos)
)
); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
OmerGronich
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It needs to be added to the HTTP request: