-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
Curious how forking and joining might be accomplished with this library?
..similar to this.
Something like this looks really verbose (and isn't really parallel), so assuming there is a better way?
var processedBags = []
var transformFragile = compose(
filter(x => x.bagType == 'fragile'),
map(x => merge(x,{luggageTag: 'Handle with care'}))
);
var transformHeavy = compose(
filter(x => x.bagType == 'heavy'),
map(x => merge(x,{luggageTag: 'Watch your back!!'}))
);
var transformNormal = filter(x => x.bagType == 'normal')
processedBags = into(processedBags, transformFragile, bags)
processedBags = into(processedBags, transformHeavy, bags)
processedBags = into(processedBags, transformNormal, bags)
Also attempted other variations w/a switch statement inside a mapper. Also doesn't feel right.
Thanks in advance.
Metadata
Metadata
Assignees
Labels
No labels