Kotlin-Flow-Android-Examples - Learn Flow for Android by Examples
This project is for:
- Who wants to learn Kotlin Flow
Just Build the project and start learning Flow by examples.
If you want to get started with Kotlin Flow, checkout the blog
Kotlin Flow Operators Examples present in this sample project
Filter-> Returns a flow containing only values of the original flow that matches the given condition
Zip-> Zips values from the current flow with another flow
FilterIsInstance-> Returns a flow containing only values that are instances of specified data type
FilterNot-> Returns a flow containing only values of the original flow that do not match the given condition
FilterNotNull-> Returns a flow containing only values of the original flow that are not null.
FlatMapConcat-> Transforms the flow and then concatenating and flattening these flows.
FlatMapLatest-> Transforms the flow and then flattening last flows
FlatMapMerge-> Transforms elements emitted by the original flow, that returns another flow, and then merging and flattening these flows.
FlattenConcat-> Flattens the given flow of flows into a single flow
DistinctUntilChanged-> suppress duplicate items emitted
FlattenMerge-> Flattens the given flow of flows into a single flow with alimit on the number of concurrently collected flows.
Map-> Returns a flow containing the results of applying the given condition
Merge-> Merges the given flows into a single flow without preserving an order of elements.
OnCompletion-> Invokes it when the given flow is completed or cancelled
OnStart-> Invokes it when the given flow is started
ScanReduce-> Reduces the given flow with give condition, emitting every intermediate result, including initial value
TransformLatest-> Transforms the last item collected from flow
If this project helps you in anyway, show your love
❤️ by putting a ⭐️ on this project ✌️
Copyright (C) 2020 MINDORKS NEXTGEN PRIVATE LIMITED Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.