derivedStateOf VS. remember(key) - THIS is Really the Difference 🤯

  Рет қаралды 14,228

Philipp Lackner

Philipp Lackner

4 ай бұрын

This video will show you the difference of derivedStateOf VS. remember(key).
💻 Let me be your mentor and become an industry-ready Android developer in 10 weeks:
pl-coding.com/drop-table-ment...
⭐ Courses with real-life practices
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:
pl-coding.com/premium-courses...
Get my FREE PDF about 20 things you should never do in Jetpack Compose:
pl-coding.com/jetpack-compose...
Regular programming advice on my Instagram page: / _philipplackner_
Join my Discord server:
/ discord
Get the source code for this video on GitHub:
github.com/philipplackner/rem...

Пікірлер: 48
@stanleykou5643
@stanleykou5643 4 ай бұрын
Your "20 things you should never do in Jetpack Compose" PDF was super useful. Jetpack compose is full of traps, and your tip is like a mine detector!
@ErnestoVega
@ErnestoVega 3 ай бұрын
How did you get it, please? I already got subscribed to the newsletter but I can't find nor get it anywhere.
@lr56c60
@lr56c60 3 ай бұрын
Could you temporarily upload it to a cloud? I haven't been able to click the button for several weeks. I have tried different internet providers and devices. Thanks
@pelealexandru
@pelealexandru 3 ай бұрын
I want it as well. Where do we get it?
@lr56c60
@lr56c60 3 ай бұрын
@@pelealexandru did you try phillip's page? I am asking here because the button to obtain the pdf on his page does not work for me.
@pelealexandru
@pelealexandru 3 ай бұрын
yes just tried it 10 minutes ago but didn't get the pdf @@lr56c60
@Alchemist10241
@Alchemist10241 3 ай бұрын
7:41 the best explanation I've ever heard or read that clarifies the use case of these two function, well done Philipp 👍
@callebdev
@callebdev 4 ай бұрын
Thanks a lot Philipp. I was also struggling to understand the difference between both of them. Your explanation was literally amazing! 💯
@solokiller5883
@solokiller5883 3 ай бұрын
I always watch your videos because they are very helpful and moreover you break things down in a clear and easy way, your pdf is amazing
@chorvico
@chorvico 3 ай бұрын
Awesome explanation! Thanks for sharing this!
@AdevAxmeddev
@AdevAxmeddev 4 ай бұрын
Thanks a lot Philipp Lackner. It is amazing...!
@mbpiku
@mbpiku 3 ай бұрын
This was really insightful, thanks 🙏
@AdrianTache
@AdrianTache 4 ай бұрын
Compose always feels like such an unfinished project... I'd expect `remember` to handle all these kinds of edge cases under the hood and prevent recompositions as needed, rather than requiring all these clumsy hacks to either prevent or force recompositions, depending on the situation. Having said that, thanks for the video, it's a nice summary of these issues and how to solve them!
@ChrisAthanas
@ChrisAthanas 3 ай бұрын
The documentation is improving slowly and compose is definitely an improvement over the xml madness
@AdrianTache
@AdrianTache Ай бұрын
@@ChrisAthanas not sure I entirely agree, Compose just hides away a lot of what is still happening to views, turning annoying issues into hidden annoying issues. I'm still a fan, primarily because we're finally getting rid of states inside views (with some horrific exceptions, like how that stupid text selection can STILL crash your app because it get stuck in the wrong state sometimes), but it's probably going to be years until it's actually at a comparable level of stability with xml.
@alexeysimchenko7494
@alexeysimchenko7494 3 ай бұрын
I knew that case but always is good to repeat) And I found out from this video that derivedStateOf is not updated if argument is updated and I need to pass such agrument as a key to remember. Thanks for mentioning that
@mortezamgh1347
@mortezamgh1347 9 күн бұрын
Thanks dear Philipp, very useful tutorial 👍
@-ECE-SOGATAKAR
@-ECE-SOGATAKAR 4 ай бұрын
Thanks you are doing great job ❤
@LasradoRohan
@LasradoRohan 4 ай бұрын
You are reading my mind at this point
@PhilippLackner
@PhilippLackner 3 ай бұрын
You're welcome
@stewie2k519
@stewie2k519 3 ай бұрын
Hey, I've watched your video about Content Providers. I am currently working with one of them - Calendar Provider, developing a small calendar-app. Do you have any other videos on this topic or maybee you can reccomend some other sources where I can read/watch about this specific provider? Espicially about syncing calendars from local storage to a server and vice-versa. And another thing is - is there some library that provides a CalendarView like Google Calendar have (the monthly view grid with displayiing event's preview(titles) in each cell)? Thanks😅
@henrik908
@henrik908 3 ай бұрын
No doubt why he is the king of Jetpack compose.
@tarsilacostalonga
@tarsilacostalonga 3 ай бұрын
You are the best!!
@SSG1239
@SSG1239 3 ай бұрын
Hey Philipp, can you please make a video regarding content driven concepts & if possible some mini projects that will be a great help.
@pelealexandru
@pelealexandru 3 ай бұрын
Thanks!
@user-lr1qk5gz3i
@user-lr1qk5gz3i 4 ай бұрын
Without bias, if you were to choose between compose or views, which one would you use in your project? For a better performance.
@mustafaammar551
@mustafaammar551 3 ай бұрын
Thank you BRO
@raulprior9635
@raulprior9635 3 ай бұрын
Amazing
@varunagrawal5802
@varunagrawal5802 4 ай бұрын
U saved, thanks
@mahiainti678
@mahiainti678 4 ай бұрын
at 12:03 if my understanding is correct you can alternatively explicitly pass isEnabledState as a state into derivedStateOf and not set keys in remember. In this way derivedStateOf would monitor both of the states inside of it. I.e. `derivedStateOf { state.firstVisibleItemIndex >= 5 && isEnabledState.value }`
@muhmmedalsadig7706
@muhmmedalsadig7706 4 ай бұрын
I agree 👍
@abiodunmoses2638
@abiodunmoses2638 3 ай бұрын
If you are going to pass state as a parameter, how are you supposed to change its value ?
@mahiainti678
@mahiainti678 3 ай бұрын
@@abiodunmoses2638 just the usual way? state.value = newValue somewhere else
@jackeblan
@jackeblan 3 ай бұрын
It's better to put the isEnabled to if(showScrollToTopButton && isEnable)
@user-wt9vk2xo6v
@user-wt9vk2xo6v Ай бұрын
@@abiodunmoses2638 add another onValueChange callback
@purplehazer417
@purplehazer417 4 ай бұрын
Phillip, can you explain the difference between rememberUpdatedState(key) and remember(key) { mutableStateOf(key) }
@ubersticks
@ubersticks 3 ай бұрын
How do I get the PDF? I am already a subscriber and the link seems to be only for new subscribers.
@WakeupDev.
@WakeupDev. Ай бұрын
Vivid and helpful
@user-lx7fq2lw8j
@user-lx7fq2lw8j 4 ай бұрын
Sir i am learning jetpack compose to become android developer .Do i need to learn DSA to become android developer. Because at college placements we required DSA is it necessary
@Revakovskyi
@Revakovskyi 3 ай бұрын
Thanks so much! You're the best!
@amol1608
@amol1608 3 ай бұрын
hey Philipp, the subscription for the free PDF is not working. I tried with one mail, never got a link. I tried with another mail (that was never subscribed), got a link, but the link from the email doesn't work, I get a 404.
@mark-147
@mark-147 4 ай бұрын
How about if you put the >=5 inside the remember arg?
@fliamachado
@fliamachado 3 ай бұрын
Same question! I've that a loot, where the key is a boolean condition.
@utkubilgin2818
@utkubilgin2818 3 ай бұрын
Hi, I couldn't download the PDF
@neerajverma9226
@neerajverma9226 3 ай бұрын
Can you explain out and in generics here? RequestState {}
@vitdemidenko
@vitdemidenko 4 ай бұрын
val state by)))))))
@5erTurbo
@5erTurbo 3 ай бұрын
4:30 I guess you could still do following and it would work same as using `derivedStateOf`? `remember(state.firstVisibleItemIndex >= 5)`
The Top 3 State Management Mistakes On Android
14:30
Philipp Lackner
Рет қаралды 21 М.
Пробую самое сладкое вещество во Вселенной
00:41
Василиса наняла личного массажиста 😂 #shorts
00:22
Денис Кукояка
Рет қаралды 7 МЛН
Please be kind🙏
00:34
ISSEI / いっせい
Рет қаралды 85 МЛН
Wait for the last one! 👀
00:28
Josh Horton
Рет қаралды 15 МЛН
Performance Optimization with @Stable and @Immutable in Jetpack Compose
16:47
5 Reasons Why You Should Use Type Hints In Python
13:54
ArjanCodes
Рет қаралды 104 М.
Python or JavaScript - Which One Should YOU Learn?
8:05
Tech With Tim
Рет қаралды 157 М.
Mindset of Successful Programmers
4:56
bigboxSWE
Рет қаралды 973 М.
3 Clean Code Hacks I Bet You Didn't Know (Kotlin & Android)
12:30
Philipp Lackner
Рет қаралды 25 М.
This Is My FAVORITE Error Handling Class
28:57
Philipp Lackner
Рет қаралды 25 М.
BasicTextField2 - Everything You Need to Know 💻
14:23
Philipp Lackner
Рет қаралды 14 М.
95% Don't Understand THIS About Coroutines (Main-Safety)
9:38
Philipp Lackner
Рет қаралды 25 М.
Everything you need to know about Kotlin 2.0 🟣
11:05
Stevdza-San
Рет қаралды 49 М.
Дени против умной колонки😁
0:40
Deni & Mani
Рет қаралды 12 МЛН
Apple watch hidden camera
0:34
_vector_
Рет қаралды 64 МЛН
APPLE совершила РЕВОЛЮЦИЮ!
0:39
ÉЖИ АКСЁНОВ
Рет қаралды 2,1 МЛН
i like you subscriber ♥️♥️ #trending #iphone #apple #iphonefold
0:14
ТОП-5 культовых телефонов‼️
1:00
Pedant.ru
Рет қаралды 19 М.