Skip to content

Commit 36c528d

Browse files
authored
feat: extract fun start() to unleash interface (#134)
1 parent bebc809 commit 36c528d

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

unleashandroidsdk/src/main/java/io/getunleash/android/DefaultUnleash.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ class DefaultUnleash(
145145
}
146146
}
147147

148-
fun start(
149-
eventListeners: List<UnleashListener> = emptyList(),
150-
bootstrapFile: File? = null,
151-
bootstrap: List<Toggle> = emptyList()
148+
override fun start(
149+
eventListeners: List<UnleashListener>,
150+
bootstrapFile: File?,
151+
bootstrap: List<Toggle>
152152
) {
153153
if (!started.compareAndSet(false, true)) {
154154
Log.w(TAG, "Unleash already started, ignoring start call")

unleashandroidsdk/src/main/java/io/getunleash/android/Unleash.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package io.getunleash.android
22

3+
import io.getunleash.android.data.Toggle
34
import io.getunleash.android.data.UnleashContext
45
import io.getunleash.android.data.Variant
56
import io.getunleash.android.events.UnleashListener
67
import java.io.Closeable
8+
import java.io.File
79

810
val disabledVariant = Variant("disabled")
911

@@ -70,4 +72,13 @@ interface Unleash: Closeable {
7072
* once the initial fetch of toggles has been completed or failed.
7173
*/
7274
fun isReady(): Boolean
75+
76+
/**
77+
* Starts Unleash manually
78+
*/
79+
fun start(
80+
eventListeners: List<UnleashListener> = emptyList(),
81+
bootstrapFile: File? = null,
82+
bootstrap: List<Toggle> = emptyList()
83+
)
7384
}

0 commit comments

Comments
 (0)