Skip to content

Commit 7973dbe

Browse files
committed
Deprecates the name-optional flavor of StatelessWorkflow.action
Missed a spot in #1226.
1 parent ae3046f commit 7973dbe

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

workflow-core/src/commonMain/kotlin/com/squareup/workflow1/StatelessWorkflow.kt

+11-1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ public fun <RenderingT> Workflow.Companion.rendering(
113113
rendering: RenderingT
114114
): Workflow<Unit, Nothing, RenderingT> = stateless { rendering }
115115

116+
117+
@Deprecated(
118+
"Always provide a debugging name",
119+
ReplaceWith("action(\"TODO: debugging name\", update)")
120+
)
121+
public fun <PropsT, OutputT, RenderingT>
122+
StatelessWorkflow<PropsT, OutputT, RenderingT>.action(
123+
update: WorkflowAction<PropsT, *, OutputT>.Updater.() -> Unit
124+
): WorkflowAction<PropsT, Nothing, OutputT> = action("", update)
125+
116126
/**
117127
* Convenience to create a [WorkflowAction] with parameter types matching those
118128
* of the receiving [StatefulWorkflow]. The action will invoke the given [lambda][update]
@@ -123,7 +133,7 @@ public fun <RenderingT> Workflow.Companion.rendering(
123133
*/
124134
public fun <PropsT, OutputT, RenderingT>
125135
StatelessWorkflow<PropsT, OutputT, RenderingT>.action(
126-
name: String = "",
136+
name: String,
127137
update: WorkflowAction<PropsT, *, OutputT>.Updater.() -> Unit
128138
): WorkflowAction<PropsT, Nothing, OutputT> = action({ name }, update)
129139

0 commit comments

Comments
 (0)