-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Support dictionary in combineLatest #5022
Comments
This is something we're planning, but I'm not sure we can do until the deprecated versions of |
This would be awesome in Angular. When transitioning to observable values the view can get real messy and pyramid like: <ng-container *ngIf="(a$ | async) as a">
<ng-container *ngIf="(b$ | async) as b">
<ng-container *ngIf="(c$ | async) as c">
{{ a }} {{ b }} {{ c }}
{{ a }} {{ b }} {{ c }}
</ng-container>
</ng-container>
</ng-container> Would be nice to just use a single async pipe at the top and use values like they're not async. Ofc it's not to do with any frontend framework but it's one of the things that makes me groan about refactoring to use Rx <ng-container *ngIf="(abc$ | async) as abc">
{{ abc.a }} {{ abc.b }} {{ abc.c }}
{{ abc.a }} {{ abc.b }} {{ abc.c }}
</ng-container> |
Currently a workaround is to use array-based
It's not too bad, but it results it repeating code (also error-prone, as @Akxe has pointed out) Also it's probably not too hard to create a custom wrapper to implement that in your project. |
Is there any plan on implementing this, or at least would a pull request be considered for merging? |
You can create your own operator function as a workaround: |
@rraziel I belive this can now be closed, right? |
@Akxe this is available in rxjs 7 yes |
Feature Request
combineLatest
should accept dictionary/object same asforkJoin
. Implementation inforkJoin
#4640Reasoning
It is much easier to mess up when deconstructing array than deconstructiong object. Thus this change would enable developer to name their streams, reducing the potential for error.
The text was updated successfully, but these errors were encountered: