Skip to content

Commit 149ab27

Browse files
Use inner types for RenderContext to reduce type boilerplate.
Renamed `RenderContext` to `BaseRenderContext`, and gave both `StatelessWorkflow` and `StatefulWorkflow` their own verions of `RenderContext`. These are inner classes, so they can use the workflow's type parameters. This removes the type parameters from the `RenderContext` reference in the `render` parameter list. Both types implement `BaseWorkflowContext` however, so code that doesn't know about a particular workflow instance can use this base type and convert it to a specific `RenderContext` later, given a `Stateful/StatelessWorkflow` instance.
1 parent e874830 commit 149ab27

File tree

58 files changed

+215
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+215
-174
lines changed

samples/containers/app-poetry/src/main/java/com/squareup/sample/poetryapp/PoemListWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package com.squareup.sample.poetryapp
1717

1818
import com.squareup.sample.poetry.model.Poem
19-
import com.squareup.workflow1.RenderContext
2019
import com.squareup.workflow1.StatelessWorkflow
2120
import com.squareup.workflow1.makeEventSink
2221

@@ -27,7 +26,7 @@ object PoemListWorkflow : StatelessWorkflow<List<Poem>, Int, PoemListRendering>(
2726

2827
override fun render(
2928
props: List<Poem>,
30-
context: RenderContext<List<Poem>, Nothing, Int>
29+
context: RenderContext
3130
): PoemListRendering {
3231
// A sink that emits the given index as the result of this workflow.
3332
val sink = context.makeEventSink { index: Int -> setOutput(index) }

samples/containers/app-poetry/src/main/java/com/squareup/sample/poetryapp/PoemsBrowserWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package com.squareup.sample.poetryapp
1818
import com.squareup.sample.container.overviewdetail.OverviewDetailScreen
1919
import com.squareup.sample.poetry.PoemWorkflow
2020
import com.squareup.sample.poetry.model.Poem
21-
import com.squareup.workflow1.RenderContext
2221
import com.squareup.workflow1.Snapshot
2322
import com.squareup.workflow1.StatefulWorkflow
2423
import com.squareup.workflow1.action
@@ -42,7 +41,7 @@ object PoemsBrowserWorkflow :
4241
override fun render(
4342
props: List<Poem>,
4443
state: SelectedPoem,
45-
context: RenderContext<List<Poem>, SelectedPoem, Nothing>
44+
context: RenderContext
4645
): OverviewDetailScreen {
4746
val poems: OverviewDetailScreen =
4847
context.renderChild(PoemListWorkflow, props) { selected -> choosePoem(selected) }

samples/containers/hello-back-button/src/main/java/com/squareup/sample/hellobackbutton/AreYouSureWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import com.squareup.sample.hellobackbutton.AreYouSureWorkflow.Finished
2121
import com.squareup.sample.hellobackbutton.AreYouSureWorkflow.State
2222
import com.squareup.sample.hellobackbutton.AreYouSureWorkflow.State.Quitting
2323
import com.squareup.sample.hellobackbutton.AreYouSureWorkflow.State.Running
24-
import com.squareup.workflow1.RenderContext
2524
import com.squareup.workflow1.Snapshot
2625
import com.squareup.workflow1.StatefulWorkflow
2726
import com.squareup.workflow1.WorkflowAction.Companion.noAction
@@ -59,7 +58,7 @@ object AreYouSureWorkflow : StatefulWorkflow<Unit, State, Finished, AlertContain
5958
override fun render(
6059
props: Unit,
6160
state: State,
62-
context: RenderContext<Unit, State, Finished>
61+
context: RenderContext
6362
): AlertContainerScreen<*> {
6463
val ableBakerCharlie = context.renderChild(HelloBackButtonWorkflow, Unit) { noAction() }
6564

samples/containers/hello-back-button/src/main/java/com/squareup/sample/hellobackbutton/HelloBackButtonWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import com.squareup.sample.hellobackbutton.HelloBackButtonWorkflow.State
2121
import com.squareup.sample.hellobackbutton.HelloBackButtonWorkflow.State.Able
2222
import com.squareup.sample.hellobackbutton.HelloBackButtonWorkflow.State.Baker
2323
import com.squareup.sample.hellobackbutton.HelloBackButtonWorkflow.State.Charlie
24-
import com.squareup.workflow1.RenderContext
2524
import com.squareup.workflow1.Snapshot
2625
import com.squareup.workflow1.StatefulWorkflow
2726
import com.squareup.workflow1.action
@@ -51,7 +50,7 @@ object HelloBackButtonWorkflow : StatefulWorkflow<Unit, State, Nothing, Renderin
5150
override fun render(
5251
props: Unit,
5352
state: State,
54-
context: RenderContext<Unit, State, Nothing>
53+
context: RenderContext
5554
): Rendering {
5655
return Rendering(
5756
message = "$state",

samples/containers/poetry/src/main/java/com/squareup/sample/poetry/PoemWorkflow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ object PoemWorkflow : StatefulWorkflow<Poem, Int, ClosePoem, OverviewDetailScree
5858
override fun render(
5959
props: Poem,
6060
state: Int,
61-
context: RenderContext<Poem, Int, ClosePoem>
61+
context: RenderContext
6262
): OverviewDetailScreen {
6363
val previousStanzas: List<StanzaRendering> =
6464
if (state == -1) emptyList()

samples/containers/poetry/src/main/java/com/squareup/sample/poetry/StanzaListWorkflow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ object StanzaListWorkflow : StatelessWorkflow<Poem, Int, StanzaListRendering>()
2929

3030
override fun render(
3131
props: Poem,
32-
context: RenderContext<Poem, Nothing, Int>
32+
context: RenderContext
3333
): StanzaListRendering {
3434
// A sink that emits the given index as the result of this workflow.
3535
val sink = context.makeEventSink { index: Int -> setOutput(index) }

samples/containers/poetry/src/main/java/com/squareup/sample/poetry/StanzaWorkflow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ object StanzaWorkflow : StatelessWorkflow<Props, Output, StanzaRendering>() {
4242

4343
override fun render(
4444
props: Props,
45-
context: RenderContext<Props, Nothing, Output>
45+
context: RenderContext
4646
): StanzaRendering {
4747
with(props) {
4848
val sink: Sink<Output> = context.makeEventSink { setOutput(it) }

samples/dungeon/app/src/main/java/com/squareup/sample/dungeon/DungeonAppWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import com.squareup.sample.dungeon.DungeonAppWorkflow.State.ChoosingBoard
2121
import com.squareup.sample.dungeon.DungeonAppWorkflow.State.LoadingBoardList
2222
import com.squareup.sample.dungeon.DungeonAppWorkflow.State.PlayingGame
2323
import com.squareup.sample.dungeon.board.Board
24-
import com.squareup.workflow1.RenderContext
2524
import com.squareup.workflow1.Snapshot
2625
import com.squareup.workflow1.StatefulWorkflow
2726
import com.squareup.workflow1.action
@@ -57,7 +56,7 @@ class DungeonAppWorkflow(
5756
override fun render(
5857
props: Props,
5958
state: State,
60-
context: RenderContext<Props, State, Nothing>
59+
context: RenderContext
6160
): AlertContainerScreen<Any> = when (state) {
6261

6362
LoadingBoardList -> {

samples/dungeon/app/src/main/java/com/squareup/sample/dungeon/GameSessionWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import com.squareup.sample.dungeon.GameSessionWorkflow.State.Running
2424
import com.squareup.sample.dungeon.GameWorkflow.Output.PlayerWasEaten
2525
import com.squareup.sample.dungeon.GameWorkflow.Output.Vibrate
2626
import com.squareup.sample.dungeon.board.Board
27-
import com.squareup.workflow1.RenderContext
2827
import com.squareup.workflow1.Snapshot
2928
import com.squareup.workflow1.StatefulWorkflow
3029
import com.squareup.workflow1.WorkflowAction
@@ -68,7 +67,7 @@ class GameSessionWorkflow(
6867
override fun render(
6968
props: Props,
7069
state: State,
71-
context: RenderContext<Props, State, Nothing>
70+
context: RenderContext
7271
): AlertContainerScreen<Any> = when (state) {
7372

7473
Loading -> {

samples/dungeon/app/src/main/java/com/squareup/sample/dungeon/TimeMachineAppWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import com.squareup.sample.timemachine.TimeMachineWorkflow
2121
import com.squareup.sample.timemachine.shakeable.ShakeableTimeMachineRendering
2222
import com.squareup.sample.timemachine.shakeable.ShakeableTimeMachineWorkflow
2323
import com.squareup.sample.timemachine.shakeable.ShakeableTimeMachineWorkflow.PropsFactory
24-
import com.squareup.workflow1.RenderContext
2524
import com.squareup.workflow1.StatelessWorkflow
2625
import com.squareup.workflow1.renderChild
2726
import kotlin.time.ExperimentalTime
@@ -43,7 +42,7 @@ class TimeMachineAppWorkflow(
4342

4443
override fun render(
4544
props: BoardPath,
46-
context: RenderContext<BoardPath, Nothing, Nothing>
45+
context: RenderContext
4746
): ShakeableTimeMachineRendering {
4847
val propsFactory = PropsFactory { recording ->
4948
Props(paused = !recording)

samples/dungeon/common/src/main/java/com/squareup/sample/dungeon/AiWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import com.squareup.sample.dungeon.Direction.LEFT
2323
import com.squareup.sample.dungeon.Direction.RIGHT
2424
import com.squareup.sample.dungeon.Direction.UP
2525
import com.squareup.sample.dungeon.board.BoardCell
26-
import com.squareup.workflow1.RenderContext
2726
import com.squareup.workflow1.Snapshot
2827
import com.squareup.workflow1.StatefulWorkflow
2928
import com.squareup.workflow1.Worker
@@ -68,7 +67,7 @@ class AiWorkflow(
6867
override fun render(
6968
props: ActorProps,
7069
state: State,
71-
context: RenderContext<ActorProps, State, Nothing>
70+
context: RenderContext
7271
): ActorRendering {
7372
context.runningWorker(state.directionTicker) { updateDirection }
7473

samples/dungeon/common/src/main/java/com/squareup/sample/dungeon/GameWorkflow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class GameWorkflow(
106106
override fun render(
107107
props: Props,
108108
state: State,
109-
context: RenderContext<Props, State, Output>
109+
context: RenderContext
110110
): GameRendering {
111111
val running = !props.paused && !state.game.isPlayerEaten
112112
// Stop actors from ticking if the game is paused or finished.

samples/dungeon/common/src/main/java/com/squareup/sample/dungeon/PlayerWorkflow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class PlayerWorkflow(
6464
override fun render(
6565
props: ActorProps,
6666
state: Movement,
67-
context: RenderContext<ActorProps, Movement, Nothing>
67+
context: RenderContext
6868
): Rendering = Rendering(
6969
actorRendering = ActorRendering(avatar = avatar, movement = state),
7070
onStartMoving = { context.actionSink.send(StartMoving(it)) },

samples/dungeon/timemachine-shakeable/src/main/java/com/squareup/sample/timemachine/shakeable/ShakeableTimeMachineWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import com.squareup.sample.timemachine.shakeable.ShakeableTimeMachineWorkflow.Pr
2222
import com.squareup.sample.timemachine.shakeable.ShakeableTimeMachineWorkflow.State
2323
import com.squareup.sample.timemachine.shakeable.ShakeableTimeMachineWorkflow.State.PlayingBack
2424
import com.squareup.sample.timemachine.shakeable.ShakeableTimeMachineWorkflow.State.Recording
25-
import com.squareup.workflow1.RenderContext
2625
import com.squareup.workflow1.Snapshot
2726
import com.squareup.workflow1.StatefulWorkflow
2827
import com.squareup.workflow1.WorkflowAction
@@ -70,7 +69,7 @@ class ShakeableTimeMachineWorkflow<in P, O : Any, out R : Any>(
7069
override fun render(
7170
props: PropsFactory<P>,
7271
state: State,
73-
context: RenderContext<PropsFactory<P>, State, O>
72+
context: RenderContext
7473
): ShakeableTimeMachineRendering {
7574
// Only listen to shakes when recording.
7675
if (state === Recording) context.runningWorker(shakeWorker) { onShake }

samples/dungeon/timemachine/src/main/java/com/squareup/sample/timemachine/RecorderWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import com.squareup.sample.timemachine.RecorderWorkflow.RecorderProps
1919
import com.squareup.sample.timemachine.RecorderWorkflow.RecorderProps.PlaybackAt
2020
import com.squareup.sample.timemachine.RecorderWorkflow.RecorderProps.RecordValue
2121
import com.squareup.sample.timemachine.RecorderWorkflow.Recording
22-
import com.squareup.workflow1.RenderContext
2322
import com.squareup.workflow1.Snapshot
2423
import com.squareup.workflow1.StatefulWorkflow
2524
import kotlin.time.Duration
@@ -92,7 +91,7 @@ internal class RecorderWorkflow<T>(
9291
override fun render(
9392
props: RecorderProps<T>,
9493
state: Recording<T>,
95-
context: RenderContext<RecorderProps<T>, Recording<T>, Nothing>
94+
context: RenderContext
9695
): TimeMachineRendering<T> {
9796
val value = when (props) {
9897
is RecordValue -> props.value

samples/dungeon/timemachine/src/main/java/com/squareup/sample/timemachine/TimeMachineWorkflow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class TimeMachineWorkflow<P, O : Any, out R>(
8484

8585
override fun render(
8686
props: TimeMachineProps<P>,
87-
context: RenderContext<TimeMachineProps<P>, Nothing, O>
87+
context: RenderContext
8888
): TimeMachineRendering<R> {
8989
// Always render the delegate, even if in playback mode, to keep it alive.
9090
val delegateRendering =

samples/hello-terminal/hello-terminal-app/src/main/java/com/squareup/sample/helloterminal/BlinkingCursorWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package com.squareup.sample.helloterminal
1717

18-
import com.squareup.workflow1.RenderContext
1918
import com.squareup.workflow1.Snapshot
2019
import com.squareup.workflow1.StatefulWorkflow
2120
import com.squareup.workflow1.Worker
@@ -51,7 +50,7 @@ class BlinkingCursorWorkflow(
5150
override fun render(
5251
props: Unit,
5352
state: Boolean,
54-
context: RenderContext<Unit, Boolean, Nothing>
53+
context: RenderContext
5554
): String {
5655
context.runningWorker(intervalWorker) { setCursorShowing(it) }
5756
return if (state) cursorString else ""

samples/hello-terminal/hello-terminal-app/src/main/java/com/squareup/sample/helloterminal/HelloTerminalWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import com.squareup.sample.helloterminal.terminalworkflow.TerminalProps
2323
import com.squareup.sample.helloterminal.terminalworkflow.TerminalRendering
2424
import com.squareup.sample.helloterminal.terminalworkflow.TerminalRendering.Color.GREEN
2525
import com.squareup.sample.helloterminal.terminalworkflow.TerminalWorkflow
26-
import com.squareup.workflow1.RenderContext
2726
import com.squareup.workflow1.Snapshot
2827
import com.squareup.workflow1.StatefulWorkflow
2928
import com.squareup.workflow1.WorkflowAction
@@ -53,7 +52,7 @@ class HelloTerminalWorkflow : TerminalWorkflow,
5352
override fun render(
5453
props: TerminalProps,
5554
state: State,
56-
context: RenderContext<TerminalProps, State, ExitCode>
55+
context: RenderContext
5756
): TerminalRendering {
5857
val (rows, columns) = props.size
5958
val header = """

samples/hello-terminal/todo-terminal-app/src/main/java/com/squareup/sample/hellotodo/EditTextWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import com.squareup.sample.helloterminal.terminalworkflow.KeyStroke.KeyType.Char
88
import com.squareup.sample.helloterminal.terminalworkflow.TerminalProps
99
import com.squareup.sample.hellotodo.EditTextWorkflow.EditTextProps
1010
import com.squareup.sample.hellotodo.EditTextWorkflow.EditTextState
11-
import com.squareup.workflow1.RenderContext
1211
import com.squareup.workflow1.Snapshot
1312
import com.squareup.workflow1.StatefulWorkflow
1413
import com.squareup.workflow1.action
@@ -48,7 +47,7 @@ class EditTextWorkflow : StatefulWorkflow<EditTextProps, EditTextState, String,
4847
override fun render(
4948
props: EditTextProps,
5049
state: EditTextState,
51-
context: RenderContext<EditTextProps, EditTextState, String>
50+
context: RenderContext
5251
): String {
5352
context.runningWorker(props.terminalProps.keyStrokes) { key -> onKeystroke(props, key) }
5453

samples/hello-terminal/todo-terminal-app/src/main/java/com/squareup/sample/hellotodo/TodoWorkflow.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import com.squareup.sample.helloterminal.terminalworkflow.TerminalWorkflow
2626
import com.squareup.sample.hellotodo.EditTextWorkflow.EditTextProps
2727
import com.squareup.sample.hellotodo.TodoWorkflow.TodoList
2828
import com.squareup.sample.hellotodo.TodoWorkflow.TodoList.Companion.TITLE_FIELD_INDEX
29-
import com.squareup.workflow1.RenderContext
29+
import com.squareup.workflow1.BaseRenderContext
3030
import com.squareup.workflow1.Snapshot
3131
import com.squareup.workflow1.StatefulWorkflow
3232
import com.squareup.workflow1.WorkflowAction
@@ -76,14 +76,14 @@ class TodoWorkflow : TerminalWorkflow,
7676
override fun render(
7777
props: TerminalProps,
7878
state: TodoList,
79-
context: RenderContext<TerminalProps, TodoList, ExitCode>
79+
context: RenderContext
8080
): TerminalRendering {
8181

8282
context.runningWorker(props.keyStrokes) { onKeystroke(it) }
8383

8484
return TerminalRendering(buildString {
8585
@Suppress("UNCHECKED_CAST")
86-
appendln(state.renderTitle(props, context as RenderContext<TerminalProps, TodoList, Nothing>))
86+
appendln(state.renderTitle(props, context))
8787
appendln(renderSelection(state.titleSeparator, false))
8888
appendln(state.renderItems(props, context))
8989
})
@@ -118,7 +118,7 @@ private fun setLabel(
118118

119119
private fun TodoList.renderTitle(
120120
props: TerminalProps,
121-
context: RenderContext<TerminalProps, TodoList, Nothing>
121+
context: BaseRenderContext<TerminalProps, TodoList, *>
122122
): String {
123123
val isSelected = focusedField == TITLE_FIELD_INDEX
124124
val titleString = if (isSelected) {
@@ -137,7 +137,7 @@ private val TodoList.titleSeparator get() = "–".repeat(title.length + 1)
137137

138138
private fun TodoList.renderItems(
139139
props: TerminalProps,
140-
context: RenderContext<TerminalProps, TodoList, Nothing>
140+
context: BaseRenderContext<TerminalProps, TodoList, *>
141141
): String =
142142
items
143143
.mapIndexed { index, item ->

samples/hello-workflow-fragment/src/main/java/com/squareup/sample/helloworkflowfragment/HelloWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import com.squareup.sample.helloworkflowfragment.HelloWorkflow.Rendering
1919
import com.squareup.sample.helloworkflowfragment.HelloWorkflow.State
2020
import com.squareup.sample.helloworkflowfragment.HelloWorkflow.State.Goodbye
2121
import com.squareup.sample.helloworkflowfragment.HelloWorkflow.State.Hello
22-
import com.squareup.workflow1.RenderContext
2322
import com.squareup.workflow1.Snapshot
2423
import com.squareup.workflow1.StatefulWorkflow
2524
import com.squareup.workflow1.action
@@ -45,7 +44,7 @@ object HelloWorkflow : StatefulWorkflow<Unit, State, Nothing, Rendering>() {
4544
override fun render(
4645
props: Unit,
4746
state: State,
48-
context: RenderContext<Unit, State, Nothing>
47+
context: RenderContext
4948
): Rendering {
5049
return Rendering(
5150
message = state.name,

samples/hello-workflow/src/main/java/com/squareup/sample/helloworkflow/HelloWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import com.squareup.sample.helloworkflow.HelloWorkflow.Rendering
1919
import com.squareup.sample.helloworkflow.HelloWorkflow.State
2020
import com.squareup.sample.helloworkflow.HelloWorkflow.State.Goodbye
2121
import com.squareup.sample.helloworkflow.HelloWorkflow.State.Hello
22-
import com.squareup.workflow1.RenderContext
2322
import com.squareup.workflow1.Snapshot
2423
import com.squareup.workflow1.StatefulWorkflow
2524
import com.squareup.workflow1.action
@@ -45,7 +44,7 @@ object HelloWorkflow : StatefulWorkflow<Unit, State, Nothing, Rendering>() {
4544
override fun render(
4645
props: Unit,
4746
state: State,
48-
context: RenderContext<Unit, State, Nothing>
47+
context: RenderContext
4948
): Rendering {
5049
return Rendering(
5150
message = state.name,

samples/recyclerview/src/main/java/com/squareup/sample/recyclerview/AppWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import com.squareup.sample.recyclerview.inputrows.DropdownInputRow
2828
import com.squareup.sample.recyclerview.inputrows.InputRow
2929
import com.squareup.sample.recyclerview.inputrows.SwitchInputRow
3030
import com.squareup.sample.recyclerview.inputrows.TextInputRow
31-
import com.squareup.workflow1.RenderContext
3231
import com.squareup.workflow1.Snapshot
3332
import com.squareup.workflow1.StatefulWorkflow
3433
import com.squareup.workflow1.WorkflowAction
@@ -96,7 +95,7 @@ object AppWorkflow : StatefulWorkflow<Unit, State, Nothing, Rendering>() {
9695
override fun render(
9796
props: Unit,
9897
state: State,
99-
context: RenderContext<Unit, State, Nothing>
98+
context: RenderContext
10099
): Rendering {
101100
val listRendering = context.renderChild(EditableListWorkflow, Props(state.rows))
102101
val baseScreen = BaseScreen(

samples/recyclerview/src/main/java/com/squareup/sample/recyclerview/editablelistworkflow/EditableListWorkflow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import com.squareup.sample.recyclerview.editablelistworkflow.EditableListWorkflo
1919
import com.squareup.sample.recyclerview.editablelistworkflow.EditableListWorkflow.Rendering
2020
import com.squareup.sample.recyclerview.editablelistworkflow.EditableListWorkflow.State
2121
import com.squareup.sample.recyclerview.inputrows.InputRow
22-
import com.squareup.workflow1.RenderContext
2322
import com.squareup.workflow1.Snapshot
2423
import com.squareup.workflow1.StatefulWorkflow
2524
import com.squareup.workflow1.action
@@ -61,7 +60,7 @@ object EditableListWorkflow : StatefulWorkflow<Props, State, Nothing, Rendering>
6160
override fun render(
6261
props: Props,
6362
state: State,
64-
context: RenderContext<Props, State, Nothing>
63+
context: RenderContext
6564
): Rendering {
6665
return Rendering(
6766
rowValues = state.rowValues,

samples/tictactoe/common/src/main/java/com/squareup/sample/authworkflow/AuthWorkflow.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class RealAuthWorkflow(private val authService: AuthService) : AuthWorkflow,
150150
override fun render(
151151
props: Unit,
152152
state: AuthState,
153-
context: RenderContext<Unit, AuthState, AuthResult>
153+
context: RenderContext
154154
): BackStackScreen<Any> = when (state) {
155155
is LoginPrompt -> {
156156
BackStackScreen(

0 commit comments

Comments
 (0)