#kotlinflow 搜尋結果

未找到 "#kotlinflow" 的結果
未找到 "#kotlinflow" 的結果
未找到 "#kotlinflow" 的結果

#Flotlin🌊15 - transformWhile - Operator generalizes `takeWhile`. - Applies a function to each value until predicate returns true. For e.g. Continue while the download is not done on upstream flow. #Kotlin #KotlinFlow #Reactive @kotlin See below Snippet example:

imShreyasPatil's tweet image. #Flotlin🌊15 - transformWhile

- Operator generalizes `takeWhile`.
- Applies a function to each value until predicate returns true.

For e.g. Continue while the download is not done on upstream flow.

#Kotlin #KotlinFlow #Reactive @kotlin 

See below Snippet example:

#Flotlin🌊 12 - `zip()` - Zips value of current flow with other flow. - Combines the values emitted by each flow. Try it here⌨️: play.kotlinlang.org/embed?short=P4… #Kotlin #KotlinFlow #Flow

imShreyasPatil's tweet image. #Flotlin🌊 12 - `zip()`

- Zips value of current flow with other flow.
- Combines the values emitted by each flow.

Try it here⌨️:
play.kotlinlang.org/embed?short=P4…

#Kotlin #KotlinFlow #Flow

#Flotlin 5 - flowOf() - Creates a flow that produces values from specified arguments. e.g. `flowOf(1, 2, 3)` Try it here⌨️: pl.kotl.in/eeNLeMRT- #Kotlin #KotlinFlow

imShreyasPatil's tweet image. #Flotlin 5 - flowOf()

- Creates a flow that produces values from specified arguments.

e.g. `flowOf(1, 2, 3)`

Try it here⌨️:
pl.kotl.in/eeNLeMRT-

#Kotlin #KotlinFlow

#Flotlin🌊13 - `callbackFlow{}` - It allows elements to be produced by code that is running in a different context or concurrently. - It's useful when you're using listener which is an asynchronous operation. Try it here⌨️: play.kotlinlang.org/embed?short=mY… #Kotlin #KotlinFlow #Reactive

imShreyasPatil's tweet image. #Flotlin🌊13 - `callbackFlow{}`

-  It allows elements to be produced by code that is running in a different context or concurrently.
- It's useful when you're using listener which is an asynchronous operation.

Try it here⌨️:
play.kotlinlang.org/embed?short=mY…
#Kotlin #KotlinFlow #Reactive

#Flotlin🌊15 - Cancellation - Flow collection can be cancelled❌. - Here in this example, we've used `withTimeoutOrNull()` which will cancel coroutine after the specified timeout⏱️. Try it here: pl.kotl.in/YIDhuwwY1 #Kotlin #KotlinFlow

imShreyasPatil's tweet image. #Flotlin🌊15 - Cancellation

- Flow collection can be cancelled❌.
- Here in this example, we've used `withTimeoutOrNull()` which will cancel coroutine after the specified timeout⏱️.

Try it here: pl.kotl.in/YIDhuwwY1

#Kotlin #KotlinFlow

#Flotlin 2 - `map` - `map` operator can be used on the upstream flow. - It returns a downstream flow for further operations. Try it here ⌨️: (Kotlin Playground) pl.kotl.in/-EaVmBx8L?them… #Kotlin #KotlinFlow

imShreyasPatil's tweet image. #Flotlin 2 - `map`
- `map` operator can be used on the upstream flow.
- It returns a downstream flow for further operations.

Try it here ⌨️: (Kotlin Playground)
pl.kotl.in/-EaVmBx8L?them…

#Kotlin #KotlinFlow

#Flotlin🌊14 - StateFlow - It is a flow which emits updates to its collectors. - Value can be observed by collecting values from the flow. Try it here⌨️: pl.kotl.in/trmvjrOkU #Kotlin #KotlinFlow #Reactive @kotlin @KotlinWeekly @HelloKotlin


#Flotlin 1 What is Flow?🤔 👉 A cold asynchronous data stream that sequentially emits values and completes normally or with an exception. See this example: pl.kotl.in/IPQaFgRTC?them… #Kotlin #KotlinFlow

imShreyasPatil's tweet image. #Flotlin 1

What is Flow?🤔
👉 A cold asynchronous data stream that sequentially emits values and completes normally or with an exception.

See this example:
pl.kotl.in/IPQaFgRTC?them…

#Kotlin #KotlinFlow

#Flotlin 6 - Exception Transparency - Never wrap `emit()` with try and catch. - Exception caused due to upstream flow can be handled using catch operator. Try it here⌨️: play.kotlinlang.org/embed?short=b8… #Kotlin #KotlinFlow

imShreyasPatil's tweet image. #Flotlin 6 - Exception Transparency
- Never wrap `emit()` with try and catch.
- Exception caused due to upstream flow can be handled using catch operator.

Try it here⌨️:
play.kotlinlang.org/embed?short=b8…

#Kotlin #KotlinFlow

#Flotlin 3 - `filter` - Similar to the collection's operator. - Performs the operation on upstream flow. - Returns a downstream flow containing only values of the original flow that matches the given predicate. Try it here ⌨️: play.kotlinlang.org/embed?short=fP… #Kotlin #KotlinFlow

imShreyasPatil's tweet image. #Flotlin 3 - `filter`
- Similar to the collection's operator.
- Performs the operation on upstream flow. 
- Returns a downstream flow containing only values of the original flow that matches the given predicate.

Try it here ⌨️:
play.kotlinlang.org/embed?short=fP…

#Kotlin #KotlinFlow

#Flotlin 9 - `collectLatest()` - When the original flow emits a new value, action block for previous value is cancelled. - See below image, when Java, Scala and Kotlin are emitted finally, Kotlin is collected. Try it here⌨️: play.kotlinlang.org/embed?short=eg… #Kotlin #KotlinFlow #Flow

imShreyasPatil's tweet image. #Flotlin 9 - `collectLatest()`

- When the original flow emits a new value, action block for previous value is cancelled.
- See below image, when Java, Scala and Kotlin are emitted finally, Kotlin is collected.

Try it here⌨️:
play.kotlinlang.org/embed?short=eg…

#Kotlin #KotlinFlow #Flow

#Flotlin 8 - `collectIndexed()` - An operator which collects the given flow with the index of an element. - In short, 1st emit -> 0, 2nd emit ->1 and so on.. Try it here⌨️: play.kotlinlang.org/embed?short=aJ… #Kotlin #KotlinFlow #Flow

imShreyasPatil's tweet image. #Flotlin 8 - `collectIndexed()`

- An operator which collects the given flow with the index of an element.
- In short, 1st emit -> 0, 2nd emit ->1 and so on..

Try it here⌨️:
play.kotlinlang.org/embed?short=aJ…

#Kotlin #KotlinFlow #Flow

#Flotlin🌊16 - flatMap - flatMap() transforms elements emitted by upstream flow and returns another flow - Here we concatenated flows using flatMapConcat - Useful when getting value from one flow and passing it to other Try it here: pl.kotl.in/6gNjYxiUD #Kotlin #KotlinFlow

imShreyasPatil's tweet image. #Flotlin🌊16 - flatMap

- flatMap() transforms elements emitted by upstream flow and returns another flow
- Here we concatenated flows using flatMapConcat
- Useful when getting value from one flow and passing it to other

Try it here: pl.kotl.in/6gNjYxiUD

#Kotlin #KotlinFlow

#Flotlin 11 - `combineTransform()` - Combines the most recent emitted values by each flow. - The receiver is FlowCollector. You can transform emitted elements. Try it here⌨️: play.kotlinlang.org/embed?short=yS… #Kotlin #KotlinFlow #Flow

imShreyasPatil's tweet image. #Flotlin 11 - `combineTransform()`

- Combines the most recent emitted values by each flow.
- The receiver is FlowCollector. You can transform emitted elements.

Try it here⌨️:
play.kotlinlang.org/embed?short=yS…

#Kotlin #KotlinFlow #Flow

Combine multiple Kotlin flows in a list without waiting for a first value stackoverflow.com/questions/6118… #kotlincoroutines #kotlin #kotlinflow

overflow_meme's tweet image. Combine multiple Kotlin flows in a list without waiting for a first value stackoverflow.com/questions/6118… #kotlincoroutines #kotlin #kotlinflow

Loading...

Something went wrong.


Something went wrong.


United States Trends