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

Add AnyWorkflow(rendering:) to make a constant-rendering workflow #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bencochran
Copy link
Collaborator

Kotlin has Workflow.rendering(). Seems like a handy convenience for fakes and testing (and dependency injection where you support dynamic content but some consumers just want static renderings).

Checklist

  • Unit Tests
  • UI Tests
  • Snapshot Tests (iOS only)
  • I have made corresponding changes to the documentation

/// Creates an AnyWorkflow that does nothing but echo the given `rendering`.
///
/// - Note: To use with `RenderTester`, use `expectRenderingWorkflow`
public init(rendering: Rendering) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this extension adds a lot of value. Simple enough to use RenderingWorkflow as-is, and we won't need any other expect...() method.

Copy link
Collaborator

@zach-klippenstein zach-klippenstein left a comment

Choose a reason for hiding this comment

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

We have a Workflow.rendering(r: R): Workflow<Unit, Nothing, R> function that does something very similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants