Skip to content
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

Rename WorkflowAction.noop() to noAction(). #420

Merged
merged 1 commit into from
Jun 25, 2019

Conversation

zach-klippenstein
Copy link
Collaborator

Closes #412.

@zach-klippenstein zach-klippenstein added this to the kotlin v0.18.0 milestone Jun 25, 2019
@zach-klippenstein zach-klippenstein added this to In progress in Workflow (Kotlin) via automation Jun 25, 2019
@@ -43,7 +43,7 @@ interface WorkflowAction<StateT, out OutputT : Any> : (StateT) -> Pair<StateT, O
/**
* Returns a [WorkflowAction] that does nothing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could elaborate a bit in the kdoc, something like:

Returns a [WorkflowAction] that does nothing: no output is emitted, and `render` is called again with the same `state` as last time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@zach-klippenstein
Copy link
Collaborator Author

@davidapgar @bencochran Does this change make sense in Swift too? Don't want to merge unless we agree on terminology.

@davidapgar
Copy link
Collaborator

@davidapgar @bencochran Does this change make sense in Swift too? Don't want to merge unless we agree on terminology.

If I understand what this is correctly, the closest we have in Swift is a AnyWorkflowAction.identity, which is still an action, but one that doesn't change the state at all.

The usage we have for it is where there is an Output from a child that we want to "ignore" in the parent (but still have to map the output to an action).

Is this the same use case? Does a noAction still result in a new render pass?

@zach-klippenstein zach-klippenstein force-pushed the zachklipp/rename-noop-workflowaction branch from 4538063 to 49ec599 Compare June 25, 2019 19:46
@zach-klippenstein
Copy link
Collaborator Author

The usage we have for it is where there is an Output from a child that we want to "ignore" in the parent (but still have to map the output to an action).

Is this the same use case? Does a noAction still result in a new render pass?

@davidapgar Exactly. I don't like identity because that's even more opaque than noAction (it's not blindingly obvious that this thing returns a function, which is necessary to understand for that name to make sense).

@davidapgar
Copy link
Collaborator

The usage we have for it is where there is an Output from a child that we want to "ignore" in the parent (but still have to map the output to an action).
Is this the same use case? Does a noAction still result in a new render pass?

@davidapgar Exactly. I don't like identity because that's even more opaque than noAction (it's not blindingly obvious that this thing returns a function, which is necessary to understand for that name to make sense).

Makes sense. I'm good with the name (will probably make it AnyWorkflowAction.noAction or a typealias to NoAction in Swift land).

@zach-klippenstein zach-klippenstein merged commit a5c703c into master Jun 25, 2019
Workflow (Kotlin) automation moved this from In progress to Done Jun 25, 2019
@zach-klippenstein zach-klippenstein deleted the zachklipp/rename-noop-workflowaction branch June 25, 2019 20:22
@zach-klippenstein zach-klippenstein added the kotlin Affects the Kotlin library. label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kotlin Affects the Kotlin library.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Proposal: Rename noop() to noWorkflowAction()
3 participants