Skip to content

Commit

Permalink
Merge pull request #1229 from square/ray/missed-one
Browse files Browse the repository at this point in the history
Deprecates the name-optional flavor of `StatelessWorkflow.action`
  • Loading branch information
rjrjr authored Nov 8, 2024
2 parents ae3046f + b08380c commit 86dab95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion workflow-core/api/workflow-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,10 @@ public final class com/squareup/workflow1/Workflows {
public static final fun action (Lcom/squareup/workflow1/StatefulWorkflow;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
public static final fun action (Lcom/squareup/workflow1/StatelessWorkflow;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
public static final fun action (Lcom/squareup/workflow1/StatelessWorkflow;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
public static final fun action (Lcom/squareup/workflow1/StatelessWorkflow;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
public static final fun action (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
public static final fun action (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
public static final fun action (Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
public static synthetic fun action$default (Lcom/squareup/workflow1/StatelessWorkflow;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcom/squareup/workflow1/WorkflowAction;
public static final fun applyTo (Lcom/squareup/workflow1/WorkflowAction;Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
public static final fun contraMap (Lcom/squareup/workflow1/Sink;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/Sink;
public static final fun getComputedIdentifier (Lcom/squareup/workflow1/Workflow;)Lcom/squareup/workflow1/WorkflowIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ public fun <RenderingT> Workflow.Companion.rendering(
rendering: RenderingT
): Workflow<Unit, Nothing, RenderingT> = stateless { rendering }

@Deprecated(
"Always provide a debugging name",
ReplaceWith("action(\"TODO: debugging name\", update)")
)
public fun <PropsT, OutputT, RenderingT>
StatelessWorkflow<PropsT, OutputT, RenderingT>.action(
update: WorkflowAction<PropsT, *, OutputT>.Updater.() -> Unit
): WorkflowAction<PropsT, Nothing, OutputT> = action("", update)

/**
* Convenience to create a [WorkflowAction] with parameter types matching those
* of the receiving [StatefulWorkflow]. The action will invoke the given [lambda][update]
Expand All @@ -123,7 +132,7 @@ public fun <RenderingT> Workflow.Companion.rendering(
*/
public fun <PropsT, OutputT, RenderingT>
StatelessWorkflow<PropsT, OutputT, RenderingT>.action(
name: String = "",
name: String,
update: WorkflowAction<PropsT, *, OutputT>.Updater.() -> Unit
): WorkflowAction<PropsT, Nothing, OutputT> = action({ name }, update)

Expand Down

0 comments on commit 86dab95

Please sign in to comment.