Jetpack Compose - Remember Coroutine Scope Example | Side Effects | CheezyCode Hindi

  Рет қаралды 11,537

Cheezy Code

Cheezy Code

Күн бұрын

Пікірлер: 31
@sudhanshusharma9159
@sudhanshusharma9159 8 ай бұрын
counter stop noramlly. But If we rotate the screen, counter does not stop and weired value of counter it goes beyond 10 and keep on incresing. no matter how many times we rotate the screen. Any change in this as per latest doc?
@Shubhamkumar-ee8mi
@Shubhamkumar-ee8mi Жыл бұрын
Thank you so much sir. Query= So in coroutine scope we again get exception on device rotation than how we can avoid it, And what is the advantage of coroutine scope here .
@CheezyCode
@CheezyCode Жыл бұрын
exception aana is good in this case - this shows your coroutine will be cancelled...no memory leaks.... solution - to define this in view model and view model will handle your configuration changes. advantage is to call coroutines independently sab kuch apne haath mei h
@harjotsingh5570
@harjotsingh5570 Жыл бұрын
@@CheezyCode Then isn't it better to define the coroutines in ViewModel itself and have a state observable in the activity file?
@sukhwantsingh501
@sukhwantsingh501 Жыл бұрын
Hi can you please guide what is long term flutter or android native development.
@vinayshaw6238
@vinayshaw6238 Жыл бұрын
One doubt...We click on the start button and coroutine is started but what will happen if we again click on the start button even if the coroutine is not stopped.
@tanmaykhatri6061
@tanmaykhatri6061 Жыл бұрын
Thanks sir ji. When will this course be completed?
@CheezyCode
@CheezyCode Жыл бұрын
Basics saare covered h.. projects banayege bas ab
@rizwansworld
@rizwansworld 5 ай бұрын
Really cool explanation bhai. Thanks.
@iampradeephr
@iampradeephr Жыл бұрын
ok what if i declare a boolean variable in remember{} and then use it as key in LaunchedEffect() and on button click change the boolean to !boolean. it is same as using rememberCoroutineScope() right ??????
@CheezyCode
@CheezyCode Жыл бұрын
you can achieve the behavior but uska intention dusra hai....remembercoroutinescope is for running coroutines independently with the scope that is linked to your composable lifecycle....launched effect is used to run the coroutine when the initial composition happens...jo cheez jiske liye banai h ussi ka use karna hai bas....
@iampradeephr
@iampradeephr Жыл бұрын
@@CheezyCode shukriya, I rewatched it and understood.
@piyush288
@piyush288 Жыл бұрын
so the difference is just we can get exception on config changes by using rememberCoroutineScope? thats only?? @Cheezy Code
@ahsansyed4146
@ahsansyed4146 Жыл бұрын
that's not the only Advantage, we can run coroutine scope (rememberCoroutineScope) inside the button.
@haseeb776
@haseeb776 Жыл бұрын
hi can you make detail video on native android vs react native in the context of deprecations? which framework/platform is getting more deprecations(classes, methods, libraries etc)? well as far I know google is renowned for deprecations!
@CheezyCode
@CheezyCode Жыл бұрын
With Android - We love deprecations 😁 jokes apart - video banana toh mushkil hai aise topic pe...react native although is good but native wali feel aana mushkil hota hai- later stage pe code spaghetti ban jati hai...
@haseeb776
@haseeb776 Жыл бұрын
​@@CheezyCode Sir I am very frustrated with native android! mjse developers yehi bolte hain react native me ajao its better option on the other hand flutter bhi rise kr rha hai. aur kotlin multi platform duniya ki sabse bakwas cheez hai google ki traf se.😂. where should I move?
@theai2020
@theai2020 Жыл бұрын
At 10:46 the counter started from 11 any explanation
@shivam70018
@shivam70018 Жыл бұрын
Because of remember keyword
@ChocoByte
@ChocoByte Жыл бұрын
When will next video come? 🐤
@CheezyCode
@CheezyCode Жыл бұрын
done
@Shubhamkumar-ee8mi
@Shubhamkumar-ee8mi Жыл бұрын
Do we launch multiple blocks on same rememberCoroutineScope?
@CheezyCode
@CheezyCode Жыл бұрын
yes we can launch multiple coroutines
@udaysharma5228
@udaysharma5228 Жыл бұрын
Yes, also point to be noted, as scope is tied to the composable where the scope is generated, so if scope is getting used to launch co-routines in child composable, IF ANY of the child composable function disposed after launching co-routine, then the scope will not be cancelled and co-routine will keep on executing.
@balusekhar
@balusekhar Жыл бұрын
How to handle screen rotations then?
@CheezyCode
@CheezyCode Жыл бұрын
Viewmodel
@ChocoByte
@ChocoByte Жыл бұрын
@@CheezyCode ​ In Jetpack compose also, we use ViewModel ? to handle configuration changes? Or there is any alternative in compose?
@CheezyCode
@CheezyCode Жыл бұрын
ViewModels...will cover that in this playlist
@ChocoByte
@ChocoByte Жыл бұрын
@@CheezyCode okkk
@tabishkhan2012
@tabishkhan2012 Жыл бұрын
Hello Everyone app sabhi ka cheezy code me sawagat hai
@CheezyCode
@CheezyCode Жыл бұрын
😂
Yay, My Dad Is a Vending Machine! 🛍️😆 #funny #prank #comedy
00:17
When mom gets home, but you're in rollerblades.
00:40
Daniel LaBelle
Рет қаралды 134 МЛН
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 287 МЛН
95% Don't Understand THIS About Coroutines (Main-Safety)
9:38
Philipp Lackner
Рет қаралды 30 М.
Yay, My Dad Is a Vending Machine! 🛍️😆 #funny #prank #comedy
00:17