-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
query's input stream doesn't trigger the query callback #35
Comments
thxs for the hint, tried it and it works, so for me the same question is, what are the side effects? |
this might be the problem yes, I made a stackblitz where you can see the problem starts with rxjs 7.5 (7.4 is fine). I'm on a project with more than 40 queries and rx-query behaves as i want with the |
for us the downgrade to rx.js 7.4 is working, with a little jest config editing. Still the best solution would be.
@timdeschryver could you give us a hint which solution/pull request we should focus on. |
@SchlammSpringer I prefer the first option, but I suspect some tests will fail (If I remember correctly). Feel free to create a PR. |
The asyncScheduler does not guarantee the order of events. // at rx-query/__tests__/query.test.ts:501
it.only('can refresh on demand', async () => {
const values = [];
let i = 20;
for await (const value of eachValueFrom(
query('test', () => of(i++)).pipe(takeWhile(() => i <= 24, true)),
)) {
refreshQuery('test');
values.push(value);
}
console.log(valuesWithoutMutate(values))
// ...
})
// [
// { status: 'loading', retries: 0 },
// { status: 'success', data: 20 },
// { status: 'refreshing', data: 20, retries: 0 },
// { status: 'refreshing', data: 20, retries: 0 },
// { status: 'success', data: 21 },
// { status: 'success', data: 22 },
// { status: 'refreshing', data: 21, retries: 0 },
// { status: 'refreshing', data: 22, retries: 0 },
// { status: 'refreshing', data: 22, retries: 0 },
// { status: 'success', data: 23 },
// { status: 'success', data: 24 }
// ] This behavior breaks several tests... |
Same result here. |
Oh shoot.. I accidently pushed some changes to |
@timdeschryver thanks for the push. First quick impression, still strange behavior. We will investigate further. Little Update to what is "strange": Refresh and delete are not working properly and with a huge time offset, in a list of Rick and Morty characters. Same behavior with refreshQuery in our app. |
Thanks @SchlammSpringer . |
@timdeschryver thxs for the PR => #37 (comment) |
Should be resolved in v2.0.1 |
I have a project with angular 14 and I'd like to add rx-query.
I have several components on the same page whose data is retrieved from an API.
Query$ = query('query', this.activatedRoute.queryParams.pipe(map(({id, currency}) => ({id, currency}))), ({id, currency}) => this.repo.getData(id, currency) )
Unfortunately, the query's input stream doesn't trigger the query callback.
I fixed it by changing
asapScheduler
toasyncScheduler
. but I don't know enough rxjs to understand the origin of the problem.Do you expect a side effect from that?
If not, can I create a PR?
The text was updated successfully, but these errors were encountered: