Skip to content

Commit

Permalink
action: added multiparts convenience function
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Dec 3, 2022
1 parent 56de7d0 commit b276903
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions action.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ func (a Action) Suppress(expr ...string) Action {
})
}

// MultiParts splits values of an Action by given dividers and completes each segment separately.
func (a Action) MultiParts(dividers ...string) Action {
return ActionCallback(func(c Context) Action {
return a.Invoke(c).ToMultiPartsA(dividers...)
})
}

// List wraps the Action in an ActionMultiParts with given divider.
func (a Action) List(divider string) Action {
return ActionMultiParts(divider, func(c Context) Action {
Expand Down

0 comments on commit b276903

Please sign in to comment.