Skip to content

Typo in Tutorial2.md #537

Open
Open
@mitchtabian

Description

@mitchtabian

Tutorial2.md contains an extra bracket in this code snippet. I commented it below. See "<--- Here".

object RootWorkflow : StatefulWorkflow<Unit, State, Nothing, Any>() {

  //

  override fun render(
    renderProps: Unit,
    renderState: State,
    context: RenderContext
  ): Any {
    when (renderState) {
      // When the state is Welcome, defer to the WelcomeWorkflow.
      is Welcome -> {
        // Render a child workflow of type WelcomeWorkflow. When renderChild is called, the
        // infrastructure will create a child workflow with state if one is not already running.
        val welcomeScreen = context.renderChild(WelcomeWorkflow) { output ->
          // When WelcomeWorkflow emits LoggedIn, turn it into our login action.
          login(output.username)
        }
        return welcomeScreen
      }

      // When the state is Todo, defer to the TodoListWorkflow.
      is Todo -> {
        val todoScreen
        // = context.renderChild(TodoListWorkflow, Unit)) { // <--- Here
           = context.renderChild(TodoListWorkflow, Unit) {  // fixed
          TODO() // we'll handle output of TodoListWorkflow later
        }
        return todoScreen
      }
    }
  }

  //
}

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions