Operators #7491
lukaszgrudnik
started this conversation in
Ideas / Feature request
Operators
#7491
Replies: 1 comment 1 reply
-
You can use zip(users, cars, addresses).pipe(
map(([users, cars, addresses]) => ({ users, cars, addresses }))
) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I encountered an issue that I needed to subscribe several roughly 11 different observables. This problem can be solved by using zip operator, but this operator returns array that is hard do cope with in code. It's not as readable as I would wish to.Maybe you encountered such problem as well, what do you think about custom operator like this in the exmaple below ?
interface UserData {...}
interface CarData {...}
interface Address {...}
zipLikeOperator(
{
users: Observable<UserData[]>,
cars: Observable<CarData[]>,
addresses: Observable<Address[]>
}
).subscribe((data: {users: UserData[], cars: CarData[], adressess: Address[]})=> {
})
Beta Was this translation helpful? Give feedback.
All reactions