Комментарии:
this is fantastic. thanks for such amazing content Philipp. 🤝
ОтветитьGreat tutorial as always!!
ОтветитьThanks bro you are life saver
ОтветитьMate, you are legend
ОтветитьI also learned a lot of new methods like maxByOrNull thanks
ОтветитьIn the combine example, isLoggedIn, chatMessages & users have default values. They will never change.
How to make them get data from database?
in that last example, I don't understand why you say "Else we'd have to recalculate everything when any of the parameters changed". Isn't that what's happening anyways?
Isn't there a way to also get WHICH of the combined parameters changed? We might be talking about a very long list, and I don't want to recompute the entire thing if another, unrelated variable changed which would only change the variable in an easy to compute way (imagine, it'd only change a color, not the value of the list, or something similar)
u so handsome :*
ОтветитьPhillip the G.O.A.T !!!
Ответитьthank you very much!
Ответитьlegend
ОтветитьI was making the same mistake..
I’ll get it fixed tomorrow as soon as I get my hands on that laptop
This could be a good hint by IDE. When you are using state.value in operators like combine, suggest using that state in the dependents list
Similar useEffect with useState in react.
Also, as mentioned above, I tried to change flow value in a viewmodel and combine did not fired. It was only fires when items goes from repository for example
ОтветитьHi! Did you try to combine more then 5 values? When I tried I got an error about types...
ОтветитьHi Phillip, please create a fresh Series of Android Development for beginners.. Please the Updated one..
ОтветитьHello, could you make a video about navigation with TopBar? I mean how to change topBar title and back button after changing our screen. In xml we can bind our toolbar to navgraph, idk how to do that on jetpack compose in right way.
ОтветитьBest video really like your content 👍
Ответитьcombine is very usefull, I loved it 🤩
ОтветитьOh man I was actually making this mistake a lot in my project, thanks for making this video :)).
Quick question, is there any advantage to using stateFlow instead of regular states/flows when working with compose only?
Love your channel
ОтветитьThanks a lot!
ОтветитьThanks for the great tutorial.
ОтветитьI would recommend passing the timeout as first parameter to SharingStarted.WhileSubscribed(), something like 2 seconds. this will ensure that the flow will not stopped and gets recalculated after screen rotation but instead it will stop if the app is in background.
Ответитьcan you provide a tutorial about mutablestatelistof with jetpack compose
ОтветитьPhillip, bc there was not a github link to the code, I wrote the code you have here into a project. The first example worked fine, but the second example (with the combine) only accepts the initial state for the chatState StateFlow. All additional `user.update{ it + user }` or `chatMessages.update { it + message }` do not emit additional ChatStates via the `combine`.
It looks like this doesn't work as described.
You should always run your code in these examples to be sure they are working as intended!
It seems that the `combine` flow will not be re-triggered unless the values of the StateFlow variables change. Since the `List<ChatMessage>` does not change (only the contents of list change), the `combine` is never triggered. You will need to wrap the Lists and add a UUID (any random UUID) that indicates the underlying list has changed in order to trigger the `combine` to re-emit a new value. Thats the only way I could get this example to work.
Does live data have anything like this 🤔
ОтветитьI tried exactly what you did in your example @Philipp, but it only updates the second flow (localUser) once, and every time I do something on the "_users" parent flow, the "localUser" flow doesnt get updated..
ОтветитьReally Nice Tips. Thanks for this.
ОтветитьHi bro, please, make a video about the new logcat in AC)
ОтветитьmutableStateListOf<User>()
instead
MutableStateFlow<List<User>>(emptyList()>
unless I want to use sealed class ResultOf<T> and get statuses for Loading, Error, Succes. Only in this case would I use Flows.
You keep giving me reasons to no longer use Compose States. Thank you.
Ответитьwhat's your studio's theme? looks pretty cool.
ОтветитьPhillipp, it would be helpful to us if you turned on `inlay hints` so we can see the types of your variable as opposed to having to manually select "type info"
ОтветитьThank you
ОтветитьThank you for the tips as usual!
Ответитьyou are the best
ОтветитьI really like your videos, they are very informative, but could you please be aware of using 'actually', it happens too often.
ОтветитьGreat video. Thanks
ОтветитьBut this isn't related entirely to flows, you are just stating the single responsibility principal, and avoiding coupling 2 variables in 1 function, isn't it?
ОтветитьLove combine!
ОтветитьAwesome, thank you
ОтветитьExcellent, thanks. Would be interested in some practical use cases where other SharingStarted values are used.
ОтветитьWhy are you not using mutableStateListOf ?
ОтветитьWow
ОтветитьGreat video as always
ОтветитьVery informative, I dig the recent topics on the channel!
ОтветитьWhat's the difference between map{} and mapLatest{} ?
ОтветитьPlease make video on exoplayer with compose ui CONTROLS, eagerly waiting
ОтветитьI know Rx is not that popular now that flows are out there, but it would be great if you make a series explaining operators and how to combine them. Your ability to teach and the effort behind that is so incredible that learning such a painful topic as Rx might be, would make it easy to understand. Thanks for all your videos!
Ответить