Skip to content

Commit d60440d

Browse files
Merge pull request #1261 from square/zachklipp/collectosink-public
Make Flow.collectToSink public.
2 parents 3b1f13c + 8be3e0c commit d60440d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

workflow-core/api/workflow-core.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ public final class com/squareup/workflow1/Workflows {
329329
public static final fun action (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
330330
public static final fun action (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/WorkflowAction;
331331
public static final fun applyTo (Lcom/squareup/workflow1/WorkflowAction;Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
332+
public static final fun collectToSink (Lkotlinx/coroutines/flow/Flow;Lcom/squareup/workflow1/Sink;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
332333
public static final fun contraMap (Lcom/squareup/workflow1/Sink;Lkotlin/jvm/functions/Function1;)Lcom/squareup/workflow1/Sink;
333334
public static final fun getComputedIdentifier (Lcom/squareup/workflow1/Workflow;)Lcom/squareup/workflow1/WorkflowIdentifier;
334335
public static final fun getIdentifier (Lcom/squareup/workflow1/Workflow;)Lcom/squareup/workflow1/WorkflowIdentifier;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ public fun <T1, T2> Sink<T1>.contraMap(transform: (T2) -> T1): Sink<T2> = Sink {
4444
* is a lot of contention on the workflow runtime the flow will be suspended while the action is
4545
* queued.
4646
*
47-
* This method is intended to be used from [BaseRenderContext.runningSideEffect].
48-
*
4947
* Example:
5048
* ```
5149
* context.runningSideEffect("collector") {
@@ -55,7 +53,7 @@ public fun <T1, T2> Sink<T1>.contraMap(transform: (T2) -> T1): Sink<T2> = Sink {
5553
* }
5654
* ```
5755
*/
58-
internal suspend fun <T, PropsT, StateT, OutputT> Flow<T>.collectToSink(
56+
public suspend fun <T, PropsT, StateT, OutputT> Flow<T>.collectToSink(
5957
actionSink: Sink<WorkflowAction<PropsT, StateT, OutputT>>,
6058
handler: (T) -> WorkflowAction<PropsT, StateT, OutputT>
6159
) {

0 commit comments

Comments
 (0)