Skip to content

Commit

Permalink
change: opt-in serializability enforcement
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanbarrossilva committed Aug 21, 2023
1 parent df57909 commit d08596d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package com.jeanbarrossilva.loadable
* @param send Callback run whenever a [Loadable] is sent.
**/
internal fun <T> LoadableScope(
serializability: Serializability,
serializability: Serializability = Serializability.default,
send: (Loadable<T>) -> Unit
): LoadableScope<T> {
return object : LoadableScope<T>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ abstract class LoadableScope<T> internal constructor() {
*
* @see load
**/
internal abstract val serializability: Serializability
internal open val serializability = Serializability.default

/** Sends a [Loadable.Loading]. **/
suspend fun load() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.junit.Test

internal class LoadableScopeTests {
private val sent = mutableListOf<Loadable<Any?>>()
private val scope: LoadableScope<Any?> = LoadableScope(sent::add)
private val scope: LoadableScope<Any?> = LoadableScope(send = sent::add)

@After
fun tearDown() {
Expand Down

0 comments on commit d08596d

Please sign in to comment.