Skip to content

Commit

Permalink
Merge pull request bumble-tech#274 from KovalevAndrey/deprecate-metho…
Browse files Browse the repository at this point in the history
…d-to-avoid-breaking-change

Avoid breaking changes by reinstantiating and deprecating API
  • Loading branch information
KovalevAndrey authored Nov 15, 2022
2 parents a27efe3 + 7f8660f commit 6e62636
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ open class Node(
)
}

@Deprecated(
replaceWith = ReplaceWith("executeAction(action)"),
message = "Will be removed in 1.1"
)
protected suspend inline fun <reified T : Node> executeWorkflow(
crossinline action: () -> Unit
): T = executeAction(action)

protected suspend inline fun <reified T : Node> executeAction(
crossinline action: () -> Unit
): T = withContext(lifecycleScope.coroutineContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ abstract class ParentNode<NavTarget : Any>(
}
}

@Deprecated(
replaceWith = ReplaceWith("attachChild(action"),
message = "Will be removed in 1.1"
)
protected suspend inline fun <reified T : Node> attachWorkflow(
timeout: Long = ATTACH_WORKFLOW_SYNC_TIMEOUT,
crossinline action: () -> Unit
) = attachChild<T>(timeout, action)

/**
* attachChild executes provided action e.g. backstack.push(NodeANavTarget) and waits for the specific
* Node of type T to appear in the ParentNode's children list. It should happen almost immediately because it happens
Expand Down

0 comments on commit 6e62636

Please sign in to comment.