Skip to content

Improve effe.Decision to accept step directly #21

@maratori

Description

@maratori

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions