From 7973dbeeae2e4ce11e15b3c19ab1d7d2de6a9019 Mon Sep 17 00:00:00 2001 From: Ray Ryan Date: Thu, 7 Nov 2024 10:29:45 -0800 Subject: [PATCH] Deprecates the name-optional flavor of `StatelessWorkflow.action` Missed a spot in #1226. --- .../com/squareup/workflow1/StatelessWorkflow.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatelessWorkflow.kt b/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatelessWorkflow.kt index 46c44f07d..91e68782d 100644 --- a/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatelessWorkflow.kt +++ b/workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatelessWorkflow.kt @@ -113,6 +113,16 @@ public fun Workflow.Companion.rendering( rendering: RenderingT ): Workflow = stateless { rendering } + +@Deprecated( + "Always provide a debugging name", + ReplaceWith("action(\"TODO: debugging name\", update)") +) +public fun + StatelessWorkflow.action( + update: WorkflowAction.Updater.() -> Unit +): WorkflowAction = action("", update) + /** * Convenience to create a [WorkflowAction] with parameter types matching those * of the receiving [StatefulWorkflow]. The action will invoke the given [lambda][update] @@ -123,7 +133,7 @@ public fun Workflow.Companion.rendering( */ public fun StatelessWorkflow.action( - name: String = "", + name: String, update: WorkflowAction.Updater.() -> Unit ): WorkflowAction = action({ name }, update)