Flow Operators - The Ultimate Guide to Kotlin Flows (Part 2)

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ย. 2024

ความคิดเห็น • 68

  • @pablovirus
    @pablovirus ปีที่แล้ว +2

    i gotta say, the "restaurant" example at the end was super helpful to understand this. Props

  • @karthikss6501
    @karthikss6501 3 ปีที่แล้ว +22

    One of the best series and explanation I ever come across regarding flow. You simply nailed it man.

  • @deslomator
    @deslomator ปีที่แล้ว +1

    The dinner example was genius, thank you very much.

  • @thomaswaldorf2829
    @thomaswaldorf2829 3 ปีที่แล้ว +2

    I had no idea about flatMap, buffer(), conflate().. good stuff!

  • @0xpirate
    @0xpirate ปีที่แล้ว

    By far your videos are the best online source that I found to learn Android Kotlin and compose , clear and direct,,,, keep it up Philipp 👍🏾

  • @foreverrafs
    @foreverrafs 3 ปีที่แล้ว +2

    Damn couldn't have been a better explanation of conflate and buffer than this one. Thanks dude!

  • @smooth1969
    @smooth1969 2 ปีที่แล้ว

    I just want to let you know that example with eating was brilliant. Keep up!

  • @bjugdbjk
    @bjugdbjk 3 ปีที่แล้ว +2

    Hey Philip. This is by far the best vid to understand flatMap operators.
    Some comparisons for easy understanding collectLatest is similar to flatMapLatest , Buffer is similar to flatMapMerge , normal flow with different operators is similar to flatMapConcat !

  • @mrprofdemath
    @mrprofdemath 6 หลายเดือนก่อน

    The dinner analogy was a very good one, extremely helpful ! Thank you.

  • @ankit4701
    @ankit4701 3 ปีที่แล้ว +5

    Can you Please make a series like these on dagger hilt?

  • @haykmkrtchyan7093
    @haykmkrtchyan7093 ปีที่แล้ว

    About flatMapMerge: The same discouragement is applied to flatMapConcat too.
    flatMapMerge just collects the flow concurrently, i.e. emits them as soon as they are available. So there is no preserved order. Additionally, it takes concurrency value as an argument:
    concurrency: Int = DEFAULT_CONCURRENCY
    The default concurrency value is 16 but it can be changed in the JVM too. Also if we will pass 1 as a concurrency argument, it will behave the same way as flatMapConcat.

  • @sandeepmaaram
    @sandeepmaaram ปีที่แล้ว

    Very clean explanation, keep rocking. Thanks

  • @zafar_codes
    @zafar_codes 3 ปีที่แล้ว +1

    Thank you Philipp, it was easy to understand by watching your videos

  • @jpdsah
    @jpdsah 3 ปีที่แล้ว +1

    This video is very helpful. Thank you very much.

  • @nymexe
    @nymexe 2 ปีที่แล้ว

    Pretty good explanation with the restaurant) Thank you!

  • @omrihz
    @omrihz 10 หลายเดือนก่อน

    Really great tutorial series. Helped me a lot! thanks you

  • @SmartSoftek
    @SmartSoftek 3 ปีที่แล้ว +1

    Hi Philipp, Great topic, can't wait to see the third video, well done

  • @azaderahmati8593
    @azaderahmati8593 ปีที่แล้ว

    as it's complex but you make it easy for us. thank you

  • @thomasknee7844
    @thomasknee7844 2 ปีที่แล้ว +2

    Really great tutorial series. Clear and concise, has helped me a lot, thanks

  • @arash1684
    @arash1684 2 ปีที่แล้ว

    This is a sample of a good tutorial thanks

  • @marcusn.6515
    @marcusn.6515 ปีที่แล้ว

    Great video, really helped me to get into the different indications of using different operators. Got triggered by how you pronounced "dessert" but that just helped me focus more :-D
    Keep up the great work!

  • @go_better
    @go_better 2 ปีที่แล้ว

    Sheesh! That's tough, especially flat mappers. But other things..mooostly make sense! Just some practice is needed.

  • @zakariamessai5447
    @zakariamessai5447 2 ปีที่แล้ว

    Awesome examples! The explanation is very clear, thank you

  • @heshamabdo6024
    @heshamabdo6024 ปีที่แล้ว

    Really great tutorial series

  • @finaalfionita8392
    @finaalfionita8392 ปีที่แล้ว

    nice explanation.

  • @eunjeongchoi5074
    @eunjeongchoi5074 3 ปีที่แล้ว +1

    nice video thank you always Philipp! I would also love to know how all these are applied in the real project!

  • @xandrviking1113
    @xandrviking1113 2 ปีที่แล้ว

    Thanks Philipp 👍🇺🇦

  • @noahhcams
    @noahhcams 2 ปีที่แล้ว

    Didn't know what the fold method did until now 👍🏾

  • @emreergun1978
    @emreergun1978 4 หลายเดือนก่อน

    👨🏻‍💻 Great job bro

  • @hussein9577
    @hussein9577 3 ปีที่แล้ว

    just great as usual !

  • @Rafael-hk9pg
    @Rafael-hk9pg 2 ปีที่แล้ว +1

    Overall, great tutorial quality Philipp. I really miss more actual use-case examples like shown at 16:00

  • @prateeksharma5340
    @prateeksharma5340 2 ปีที่แล้ว

    Great teacher

  • @dmytromarchuk3023
    @dmytromarchuk3023 ปีที่แล้ว

    Hey thanks for the video. I disagree that flatMapMerge is less used and is not recommended. If order does not matter and all you need is just a result, this operator comes into play and can even be more efficient

  • @rogercolque
    @rogercolque 3 ปีที่แล้ว +1

    Hi. nice content.
    with list also can use map.
    val numbers = listOf(1, 2, 3)
    println(numbers.map { it * it }) // [1, 4, 9]
    any differentes or benefits?

  • @minatokakarothatake9773
    @minatokakarothatake9773 2 ปีที่แล้ว

    Hi Philip , could you explain callbackFlows with Retrofit api calls, I have a UseCase (which behaves as an executor) talking to repo to make api calls , problem is it has a success failure callback , and through this callback only viewmodel understands the Success and failure of api

  • @CybercoderNaj
    @CybercoderNaj 3 ปีที่แล้ว +1

    For the recipes example that you have provided, we can also use the normal map function, right? I don't understand the difference in functionality.

    • @PhilippLackner
      @PhilippLackner  3 ปีที่แล้ว

      No, a single recipe is coming in as a flow, not as a recipe. That flow emits multiple values: first the single recipe from the DB, then the recipe from the API.
      And you want all recipes as a list in a single flow

    • @CybercoderNaj
      @CybercoderNaj 3 ปีที่แล้ว

      @@PhilippLackner oh okayy. Since the return type of the mapping function will return a flow that needs to be collected, we'll use flatMapConcat. Gotchaaa

  • @path_ethics
    @path_ethics 2 ปีที่แล้ว +1

    Loved the video. Does buffer() and conflate() operators have anything to do with the term "backpressure" management?

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว +1

      Kind of, yeah. Flows already have the natural backpressure mechanism that they will only emit if the collector finished collecting. With buffer() and conflate() you can change the way this is happening which can lead to faster execution in specific scenarios :)

    • @neil2444
      @neil2444 2 ปีที่แล้ว

      @@PhilippLackner It would seem to me that a good application for conflate would be say, some sort of status update, and rather than have to process each individual update (assuming they aren't incremental updates), you discard in favor for the most recent. For instance, I have 3 stock market changes, and I only run the code to update the status on the most recent of the three.

  • @dev_jeongdaeri
    @dev_jeongdaeri 3 ปีที่แล้ว

    Always best👍👍👍👍

  • @calibur5518
    @calibur5518 3 ปีที่แล้ว

    Hi Phillip first of all thank you for your Videos
    Please tech us how we can multiply 4 number in kotlin
    lets say we have
    2 textNumbers =
    car price
    month
    outputs for user when it click on button it shows this
    3 textviews =
    downpayment
    processing fee
    monthly fee
    1 button =
    shows all 3 text views
    formula is >
    val balance = 0.60
    val intrest = 0.013
    val downpayment = 0.40
    val proccessing = 0.55
    val f1 = carprice * balance * interest * month
    downpayment = car price * downpayment
    monthly fee = (car price * balance ) + (f1) / month
    processing fee = car price * balance * processing fee

  • @bautp
    @bautp 3 ปีที่แล้ว

    I have a question, If I have multi request in flow and a request response failed ,what is the result final?
    Example : getRecipeById with 5 request ,but one in 5 request response return fail.

  • @mohammadfekri4987
    @mohammadfekri4987 3 ปีที่แล้ว

    nice. i follow all your video

  • @mrpi230
    @mrpi230 2 ปีที่แล้ว

    If the emission is emitting many value in one second then how to collect one value and ignore all other values. Please answer Thank You.

  • @varunjohnjohn
    @varunjohnjohn ปีที่แล้ว

    Thanks bro

  • @mrpi230
    @mrpi230 2 ปีที่แล้ว

    How to ignore all values within one second in Sharedflow. Please answer thank you.

  • @antoniocld
    @antoniocld 3 ปีที่แล้ว

    Thank you

  • @sundostamimi4303
    @sundostamimi4303 ปีที่แล้ว

    big thanx

  • @funnymoment9164
    @funnymoment9164 3 ปีที่แล้ว

    Thanks!

  • @androiddev7267
    @androiddev7267 2 ปีที่แล้ว

    Can you please make this it without using jetpack compose
    ?

  • @ashutoshsingh6455
    @ashutoshsingh6455 2 ปีที่แล้ว

    How can we call multiple api call simultaneously using flow

  • @berkc5323
    @berkc5323 2 ปีที่แล้ว

    golden

  • @jopadjr
    @jopadjr 2 ปีที่แล้ว

    654th...Thanks Philipp

  • @mark99999ish
    @mark99999ish 2 ปีที่แล้ว

    Ordering in a restaurant is a great abstraction.

  • @hamzaakram6270
    @hamzaakram6270 3 ปีที่แล้ว

    Where is third video ?

  • @MrVipulLal
    @MrVipulLal 2 ปีที่แล้ว

    Great video, but please increase your font size… it’s too small

  • @designertv3416
    @designertv3416 3 ปีที่แล้ว

    hi, make tutorial about :how i encrypt app in android studio 🌷🌷 thanx

  • @rabaka7899
    @rabaka7899 3 ปีที่แล้ว

    Great

  • @siva_subramaniam
    @siva_subramaniam ปีที่แล้ว

    bm - 13:02

  • @rahul_spawar
    @rahul_spawar 2 ปีที่แล้ว

    So not major difference between collect{} and onEach{}

  • @calixtoandrade996
    @calixtoandrade996 3 ปีที่แล้ว

    niceeeee

  • @yevhenvoronetskyi8192
    @yevhenvoronetskyi8192 3 ปีที่แล้ว

    cool

  • @anshulkabra1210
    @anshulkabra1210 3 ปีที่แล้ว

    Hey. Please create a series on KMM as well.