Skip to content

Commit 415093a

Browse files
Deprecate older Worker helpers that are now easier to do by using side effects directly.
1 parent 585ba45 commit 415093a

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

workflow-core/src/main/java/com/squareup/workflow/LifecycleWorker.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import kotlinx.coroutines.suspendCancellableCoroutine
2828
* A [Worker] is stopped when its parent [Workflow] finishes a render pass without running the
2929
* worker, or when the parent workflow is itself torn down.
3030
*/
31+
@Deprecated("Use runningSideEffect instead.")
3132
abstract class LifecycleWorker : Worker<Nothing> {
3233

3334
/**

workflow-core/src/main/java/com/squareup/workflow/Worker.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ interface Worker<out OutputT> {
220220
* call, or can use the `key` parameter to [RenderContext.runningWorker] to prevent conflicts.
221221
* ```
222222
*/
223+
@Deprecated("Use runningSideEffect instead.")
223224
fun createSideEffect(
224225
block: suspend () -> Unit
225226
): Worker<Nothing> = TypedWorker(TYPE_OF_NOTHING, flow { block() })

0 commit comments

Comments
 (0)