Skip to content

Commit

Permalink
Merge pull request #11 from hotwired/match-turbo-apis
Browse files Browse the repository at this point in the history
Update the public delegate APIs to match `turbo-android`
  • Loading branch information
jayohms authored Apr 6, 2023
2 parents 326923d + f294567 commit 310b393
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions strada/src/main/kotlin/dev/hotwire/strada/BridgeDelegate.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class BridgeDelegate<D : BridgeDestination>(
observeLifeCycle()
}

fun loadBridgeInWebView() {
fun onColdBootPageCompleted() {
bridge?.load()
}

fun resetBridge() {
fun onColdBootPageStarted() {
bridge?.reset()
}

Expand All @@ -38,7 +38,7 @@ class BridgeDelegate<D : BridgeDestination>(

if (bridge != null) {
if (shouldReloadBridge()) {
loadBridgeInWebView()
bridge?.load()
}
} else {
logEvent("bridgeNotInitializedForWebView", destination.bridgeDestinationLocation())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ class BridgeDelegateTest {
}

@Test
fun loadBridgeInWebView() {
delegate.loadBridgeInWebView()
fun onColdBootPageCompleted() {
delegate.onColdBootPageCompleted()
verify(bridge).load()
}

@Test
fun resetBridge() {
delegate.resetBridge()
fun onColdBootPageStarted() {
delegate.onColdBootPageStarted()
verify(bridge).reset()
}

Expand Down

0 comments on commit 310b393

Please sign in to comment.