Skip to content

Commit 86dab95

Browse files
authored
Merge pull request #1229 from square/ray/missed-one
Deprecates the name-optional flavor of `StatelessWorkflow.action`
2 parents ae3046f + b08380c commit 86dab95

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

workflow-core/api/workflow-core.api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,10 @@ public final class com/squareup/workflow1/Workflows {
411411
public static final fun action (Lcom/squareup/workflow1/StatefulWorkflow;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
412412
public static final fun action (Lcom/squareup/workflow1/StatelessWorkflow;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
413413
public static final fun action (Lcom/squareup/workflow1/StatelessWorkflow;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
414+
public static final fun action (Lcom/squareup/workflow1/StatelessWorkflow;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
414415
public static final fun action (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
415416
public static final fun action (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
416417
public static final fun action (Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
417-
public static synthetic fun action$default (Lcom/squareup/workflow1/StatelessWorkflow;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcom/squareup/workflow1/WorkflowAction;
418418
public static final fun applyTo (Lcom/squareup/workflow1/WorkflowAction;Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
419419
public static final fun contraMap (Lcom/squareup/workflow1/Sink;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/Sink;
420420
public static final fun getComputedIdentifier (Lcom/squareup/workflow1/Workflow;)Lcom/squareup/workflow1/WorkflowIdentifier;

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ public fun <RenderingT> Workflow.Companion.rendering(
113113
rendering: RenderingT
114114
): Workflow<Unit, Nothing, RenderingT> = stateless { rendering }
115115

116+
@Deprecated(
117+
"Always provide a debugging name",
118+
ReplaceWith("action(\"TODO: debugging name\", update)")
119+
)
120+
public fun <PropsT, OutputT, RenderingT>
121+
StatelessWorkflow<PropsT, OutputT, RenderingT>.action(
122+
update: WorkflowAction<PropsT, *, OutputT>.Updater.() -> Unit
123+
): WorkflowAction<PropsT, Nothing, OutputT> = action("", update)
124+
116125
/**
117126
* Convenience to create a [WorkflowAction] with parameter types matching those
118127
* of the receiving [StatefulWorkflow]. The action will invoke the given [lambda][update]
@@ -123,7 +132,7 @@ public fun <RenderingT> Workflow.Companion.rendering(
123132
*/
124133
public fun <PropsT, OutputT, RenderingT>
125134
StatelessWorkflow<PropsT, OutputT, RenderingT>.action(
126-
name: String = "",
135+
name: String,
127136
update: WorkflowAction<PropsT, *, OutputT>.Updater.() -> Unit
128137
): WorkflowAction<PropsT, Nothing, OutputT> = action({ name }, update)
129138

0 commit comments

Comments
 (0)