Skip to content

Add Create effect that creates an asynchronous stream#71

Merged
DevYeom merged 1 commit into
mainfrom
create-effect
Jan 16, 2024
Merged

Add Create effect that creates an asynchronous stream#71
DevYeom merged 1 commit into
mainfrom
create-effect

Conversation

@DevYeom
Copy link
Copy Markdown
Owner

@DevYeom DevYeom commented Jan 16, 2024

Related Issues 💭

Resolves #69

Description 📝

  • Add Create effect that creates an asynchronous stream.
  • Add unit tests for Create effect.

Additional Notes 📚

func reduce(state: inout State, action: Action) -> AnyEffect<Action> {
    switch action {
// ...
        case .twice:
            return .create { continuation in
                continuation.yield(.increment)
                continuation.yield(.increment)
                continuation.finish()
            }
// ...
    }
}

Checklist ✅

  • If it's a new feature, have appropriate unit tests been added?
  • If the changes affect existing functionality, please verify whether the above information has been appropriately described.

@DevYeom DevYeom self-assigned this Jan 16, 2024
@DevYeom
Copy link
Copy Markdown
Owner Author

DevYeom commented Jan 16, 2024

@sobabear

It would be good to refer to the test_createAsynchronouslyWithCompletionHandler case.

@DevYeom DevYeom merged commit 7db913f into main Jan 16, 2024
@DevYeom DevYeom deleted the create-effect branch January 16, 2024 14:17
@sobabear
Copy link
Copy Markdown
Contributor

sobabear commented Jan 17, 2024

@DevYeom Thank you for your quick fixs!
To be honest, create syntax is what I wanted mostly. Very brilliant decision!

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.

Sequence Finished unintentionally

2 participants