Skip to content

Commit b7161f1

Browse files
Add SimpleSharedFlow
1 parent 61509c5 commit b7161f1

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ dependencies {
5454
implementation(libs.androidx.hilt.navigation.compose)
5555

5656
// debugImplementation because LeakCanary should only run in debug builds.
57-
debugImplementation("com.squareup.leakcanary:leakcanary-android:2.10")
57+
debugImplementation(libs.leakcanary)
5858
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2022, Nordic Semiconductor
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without modification, are
6+
* permitted provided that the following conditions are met:
7+
*
8+
* 1. Redistributions of source code must retain the above copyright notice, this list of
9+
* conditions and the following disclaimer.
10+
*
11+
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
12+
* of conditions and the following disclaimer in the documentation and/or other materials
13+
* provided with the distribution.
14+
*
15+
* 3. Neither the name of the copyright holder nor the names of its contributors may be
16+
* used to endorse or promote products derived from this software without specific prior
17+
* written permission.
18+
*
19+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22+
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23+
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26+
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27+
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29+
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
*/
31+
32+
package no.nordicsemi.android.common.core
33+
34+
import kotlinx.coroutines.channels.BufferOverflow
35+
import kotlinx.coroutines.flow.MutableSharedFlow
36+
37+
fun <T> simpleSharedFlow() = MutableSharedFlow<T>(
38+
extraBufferCapacity = 1,
39+
onBufferOverflow = BufferOverflow.DROP_OLDEST
40+
)

navigation/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ plugins {
3333
alias(libs.plugins.nordic.library.compose)
3434
alias(libs.plugins.nordic.hilt)
3535
alias(libs.plugins.nordic.nexus)
36-
id("kotlin-parcelize")
36+
alias(libs.plugins.kotlin.parcelize)
3737
}
3838

3939
group = "no.nordicsemi.android.common"

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dependencyResolutionManagement {
4848
}
4949
versionCatalogs {
5050
create("libs") {
51-
from("no.nordicsemi.android.gradle:version-catalog:1.2.7")
51+
from("no.nordicsemi.android.gradle:version-catalog:1.2.8")
5252
}
5353
}
5454
}

0 commit comments

Comments
 (0)