Skip to content
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

Provide combineLatest overload with vararg flow parameter #1193

Closed
qwwdfsad opened this issue May 14, 2019 · 2 comments
Closed

Provide combineLatest overload with vararg flow parameter #1193

qwwdfsad opened this issue May 14, 2019 · 2 comments
Labels

Comments

@qwwdfsad
Copy link
Collaborator

qwwdfsad commented May 14, 2019

See the original request with rationale: #437 (comment)

The key question is how (if) to provide a type-safe API.
Whether we need up to N overloads with N generic parameters or single vararg parameter of type Flow<*>

@qwwdfsad qwwdfsad added the flow label May 14, 2019
@elizarov
Copy link
Contributor

elizarov commented May 14, 2019

I'd suggest to provide type-safe overloads up to N (5-8 TBD) parameters all based on internal implementation that uses varargs and is not typesafe to save bytecode size. There is no better solution as it seems until Kotlin implements "variadic generics" (https://youtrack.jetbrains.com/issue/KT-31427)

qwwdfsad added a commit that referenced this issue May 16, 2019
  * combineLatest(Iterable<Flow<T>>) is not added deliberately, use-case is unclear
  * All specific overloads are marked as inline to reduce binary compatibility pressure

Fixes #1193
qwwdfsad added a commit that referenced this issue May 16, 2019
  * combineLatest(Iterable<Flow<T>>) is not added deliberately, use-case is unclear
  * All specific overloads are marked as inline to reduce binary compatibility pressure

Fixes #1193
@erikc5000
Copy link

Once you start combining more than two Flows, does it make more sense to have combineLatest() as a standalone function rather than an extension method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants