Thanks to visit codestin.com
Credit goes to github.com

Skip to content

WIP Rx state/connect partial obs and signals #1644

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

Conversation

michaelbe812
Copy link
Contributor

WIP PR for #1632

Tests are still in WIP

@github-actions github-actions bot added { } State @rx-angular/state related 📚 Docs Web Documentation hosted on github pages 🛂 Test Unit tests, e2e tests, integration tests, test coverage labels Nov 13, 2023
@michaelbe812
Copy link
Contributor Author

@hoebbelsB as we had the initial discussion you might want to check this PR.
Tests are still WIP (need to get familiar with the scheduled helper and how to use it with signals correctly)

}
return result;
}),
coalesceWith(timer(0))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the correct coalescing operator?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is the correct operator, but why would you coalesce it on the next macrotask? It makes much more sense to coalesce on microtask instead. Also, it shouldn't trigger ngZone.

Please try with coalesceWith(from(Promise.resolve())) and use the unpatched promise from the rx angular cdk.

We have to write tests though, that confirm RxState is not running out of zone. That could potentially cause issues when state selections are running out of zone.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, I think coalescing should happen before the mapping. This way, the mapping would be less often executed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes absolutely sense, will rework it soon

}
});

return combineLatest(observables).pipe(
Copy link
Contributor Author

@michaelbe812 michaelbe812 Nov 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should I filter out any partial which has a value of undefined?
Undefined might come from line 27

@eneajaho
Copy link
Member

Hello @mikelgo anything I can help with? In order to move this PR forward?

@michaelbe812
Copy link
Contributor Author

Hello @mikelgo anything I can help with? In order to move this PR forward?

hey @eneajaho thanks for asking.
I just lack a bit of time right now :D And I'm struggling a bit on how to write the tests in the same way as the existing tests using the scheduled-helper from rxjs. I would need to do some conversion from signals to observable to use this helper, but not sure if this would be really the way to go (I would not do it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 Docs Web Documentation hosted on github pages { } State @rx-angular/state related 🛂 Test Unit tests, e2e tests, integration tests, test coverage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants