-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace WorkflowHost with the launchWorkflowIn function. #447
Conversation
cae54fc
to
9625cf3
Compare
9625cf3
to
dab29a0
Compare
dab29a0
to
d27cff9
Compare
kotlin/workflow-runtime/src/main/java/com/squareup/workflow/RunWorkflow.kt
Outdated
Show resolved
Hide resolved
d27cff9
to
b671a8d
Compare
950136c
to
ec7ae2a
Compare
44ae211
to
f90206c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some doc suggestions, mainly aimed at over-explaining behavior of [beforeStart] a bit more. I also think RunnerT
would be a better name than ResultT
.
I'm pretty thrilled with this change.
kotlin/workflow-runtime/src/main/java/com/squareup/workflow/LaunchWorkflow.kt
Show resolved
Hide resolved
kotlin/workflow-runtime/src/main/java/com/squareup/workflow/LaunchWorkflow.kt
Outdated
Show resolved
Hide resolved
kotlin/workflow-runtime/src/main/java/com/squareup/workflow/LaunchWorkflow.kt
Outdated
Show resolved
Hide resolved
kotlin/workflow-runtime/src/main/java/com/squareup/workflow/LaunchWorkflow.kt
Outdated
Show resolved
Hide resolved
kotlin/workflow-runtime/src/main/java/com/squareup/workflow/LaunchWorkflow.kt
Show resolved
Hide resolved
kotlin/workflow-runtime/src/main/java/com/squareup/workflow/internal/Workers.kt
Show resolved
Hide resolved
kotlin/workflow-runtime/src/main/java/com/squareup/workflow/internal/WorkflowLoop.kt
Show resolved
Hide resolved
kotlin/workflow-testing/src/main/java/com/squareup/workflow/testing/WorkflowTester.kt
Outdated
Show resolved
Hide resolved
kotlin/workflow-testing/src/main/java/com/squareup/workflow/testing/WorkflowTester.kt
Show resolved
Hide resolved
kotlin/workflow-testing/src/main/java/com/squareup/workflow/testing/WorkflowTester.kt
Show resolved
Hide resolved
f90206c
to
bf58c4d
Compare
@rjrjr Just pushed to address your comments, PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could iterate on the word-smithing forever.
* the root workflow's [StatefulWorkflow.initialState], and subsequent emissions are passed as | ||
* input updates to the root workflow. | ||
* @param initialSnapshot If not null, used to restore the workflow. | ||
* @param beforeStart Called exactly once with the flows for renderings/snapshots and outputs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still find "It also gets a sub-scope" confusing since the scope is this
, not a parameter. That's what got me talking about receiver elsewhere, although I take your point that that's a weird term too -- this ain't Smalltalk. Called on doesn't work for you?
First commit just does some refactoring to make the next commit diff cleaner.
The new API is a single function:
See the kdoc on that function for details.
Closes #439.