Skip to content

Commit 87b4914

Browse files
committed
Make RealStore open for testing
Signed-off-by: matt-ramotar <[email protected]>
1 parent a59ed88 commit 87b4914

File tree

1 file changed

+3
-3
lines changed
  • store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/impl

1 file changed

+3
-3
lines changed

store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/impl/RealStore.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import org.mobilenativefoundation.store.store5.impl.operators.Either
4242
import org.mobilenativefoundation.store.store5.impl.operators.merge
4343
import org.mobilenativefoundation.store.store5.internal.result.StoreDelegateWriteResult
4444

45-
internal class RealStore<Key : Any, Network : Any, Output : Any, Local : Any>(
45+
internal open class RealStore<Key : Any, Network : Any, Output : Any, Local : Any>(
4646
scope: CoroutineScope,
4747
fetcher: Fetcher<Key, Network>,
4848
sourceOfTruth: SourceOfTruth<Key, Local, Output>? = null,
@@ -327,7 +327,7 @@ internal class RealStore<Key : Any, Network : Any, Output : Any, Local : Any>(
327327
}
328328
}
329329

330-
internal suspend fun write(
330+
internal open suspend fun write(
331331
key: Key,
332332
value: Output,
333333
): StoreDelegateWriteResult =
@@ -339,7 +339,7 @@ internal class RealStore<Key : Any, Network : Any, Output : Any, Local : Any>(
339339
StoreDelegateWriteResult.Error.Exception(error)
340340
}
341341

342-
internal suspend fun latestOrNull(key: Key): Output? = fromMemCache(key) ?: fromSourceOfTruth(key)
342+
internal open suspend fun latestOrNull(key: Key): Output? = fromMemCache(key) ?: fromSourceOfTruth(key)
343343

344344
private suspend fun fromSourceOfTruth(key: Key) =
345345
sourceOfTruth?.reader(key, CompletableDeferred(Unit))?.map { it.dataOrNull() }?.first()

0 commit comments

Comments
 (0)