Skip to content

Commit

Permalink
Merge pull request #606 from rsteube/action-list
Browse files Browse the repository at this point in the history
added Action.List
  • Loading branch information
rsteube authored Nov 22, 2022
2 parents 9cb229c + 2a4093e commit 902c5f7
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 @@ -163,6 +163,13 @@ func (a Action) Suppress(expr ...string) Action {
})
}

// List wraps the Action in an ActionMultiParts with given divider.
func (a Action) List(divider string) Action {
return ActionMultiParts(divider, func(c Context) Action {
return a.Invoke(c).ToA().NoSpace()
})
}

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

0 comments on commit 902c5f7

Please sign in to comment.