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

Improve effe.Decision to accept step directly #21

Open
maratori opened this issue Oct 2, 2020 · 0 comments
Open

Improve effe.Decision to accept step directly #21

maratori opened this issue Oct 2, 2020 · 0 comments

Comments

@maratori
Copy link
Contributor

maratori commented Oct 2, 2020

Let's make it possible to write following flow

func A() error {
	effe.BuildFlow(
		effe.Decision(step1, effe.Failure(failure),
			effe.Case("a", effe.Step(step2)),
			effe.Case("", effe.Step(step3)),
		),
	)
	return nil
}

instead of current

func A() error {
effe.BuildFlow(
effe.Step(step1),
effe.Decision(new(a), effe.Failure(failure),
effe.Case("a", effe.Step(step2)),
effe.Case("", effe.Step(step3)),
),
)
return nil
}

The difference is that Decision applies function with single return value as the first argument.

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

No branches or pull requests

1 participant