alec
12/08/2021, 3:35 PMalec
12/08/2021, 3:35 PMhfhbd
12/08/2021, 3:42 PMalec
12/08/2021, 3:44 PMalec
12/08/2021, 3:44 PMhfhbd
12/08/2021, 3:51 PMalec
12/08/2021, 4:19 PMhfhbd
12/08/2021, 4:43 PMalec
12/08/2021, 5:04 PMalec
12/08/2021, 5:04 PMspierce7
12/08/2021, 7:55 PMMoleculePresenter
interface actually look like? The example given in your blog post doesn’t seem possible without generics:
class CounterPresenter @Inject constructor(
private val randomService: RandomService,
) : MoleculePresenter {
@Composable
override fun Present(events: Flow<CounterEvent>) : CounterModel {
// ...
}
}
jw
12/08/2021, 7:56 PMspierce7
12/10/2021, 7:34 PMIt's not ready for a 1.0 because there are some tradeoffs in how we're using Compose and in the shape of our APIs that we're not 100% sure are the right ones to make.
What are some of these tradeoffs that you are talking about?jw
12/10/2021, 7:56 PMjw
12/10/2021, 7:57 PMspierce7
12/10/2021, 8:23 PMFlow<Model>
? Is there an example somewhere I could get an example of what you guys are doing?jw
12/10/2021, 8:29 PMjw
12/10/2021, 8:29 PMspierce7
12/10/2021, 8:40 PMjw
12/10/2021, 8:43 PMsaket
12/10/2021, 8:58 PMjw
12/10/2021, 9:02 PMspierce7
12/10/2021, 9:15 PMjw
12/10/2021, 9:17 PMdave08
12/12/2021, 4:54 PM@MergeSubcomponent
)AND a scope annotation for Dagger... there's no way to use the annotation for both I suppose?Niko
12/13/2021, 11:00 AMdata class A { name: String, value: Int }
that is used by the internals of the library for calculations and what not.
In addition, I have Android client (and backend service in the future) that on top of the `A`'s fields would need to have some info, like database ID, timestamps etc.
Writing the queries, I'm given the generated projections for the queries, but what if I wanted for the returned types to extend the library type's field and functionalities?
Can the projections extend other types?
Or write a custom mapper
to return another type having both types via composition/delegation?
Or am I just over-thinking this issue, and would the projections just be enough (most of the time they would, if they were just stupid data containers for the UI, but for some calculations they wouldn't cut it)? If I wanted to avoid redundant code-duplication, extending would be fittingsaket
12/13/2021, 3:34 PMColton Idle
12/20/2021, 8:35 AMval userFlow = db.userObservable()
val balanceFlow = db.balanceObservable()
@Composable
fun Profile() {
val user by userFlow.subscribeAsState(null)
val balance by balanceFlow.subscribeAsState(0L)
if (user == null) {
Text("Loading…")
} else {
Text("${user.name} - $balance")
}
}
Unfortunately, we are mixing business logic with display logic which makes testing harder than if it were separated. The display layer is also interacting directly with the storage layer which creates undesirable coupling. Additionally, if we want to power a different display with the same logic (potentially on another platform) we cannot.
Extracting the business logic to a presenter-like object fixes these three things.so the three things wrong with this are 1. "mixing business logic with display logic" | Is that referring to
Text("${user.name} - $balance")
?
2. "The display layer is also interacting directly with the storage layer which creates undesirable coupling" | That's reffering to val userFlow = db.userObservable()
right?
3. "if we want to power a different display with the same logic (potentially on another platform) we cannot." | I don't get that. If we were using compose for desktop, the above would work?jw
12/20/2021, 12:34 PMKamilH
12/21/2021, 11:59 AM