Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/afraid-buttons-go.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@callstack/repack": minor
---

Add configurable OkHttpClient factory for Android RemoteScriptLoader
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import java.util.concurrent.TimeUnit

class RemoteScriptLoader(val reactContext: ReactContext, private val nativeLoader: NativeScriptLoader) {
private val scriptsDirName = "scripts"
private val client = OkHttpClient()
private val client: OkHttpClient by lazy(okHttpClientFactory)

companion object {
var okHttpClientFactory: () -> OkHttpClient = { OkHttpClient() }
}

private fun getScriptFilePath(scriptUniqueId: String): String {
return "${scriptsDirName}/$scriptUniqueId.script.bundle"
Expand Down