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

Added new merge/combine function for the Saga #55

Merged
merged 1 commit into from
Jan 26, 2025
Merged

Conversation

idugalic
Copy link
Member

Key Features of the Solution

The new function merge is introduced on the Saga component. It looks like a combine function, but these are different.

The two functions (combine and merge) explicitly handle different scenarios, which makes the code more readable and reduces potential runtime complexity.

combine:

Combines two sagas that operate on different event types (E and E2) into a new saga operating on Sum<E, E2>.
This is ideal for cases where you need to handle separate types of events independently.

merge:

Composes two sagas that operate on the same event type (E) into a new saga operating on E.
Ensures both sagas dispatch their own Commands/ActionResults in response to a shared event.

@idugalic idugalic merged commit 04efe12 into main Jan 26, 2025
3 checks passed
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.

1 participant