Skip to content

Add support for channels in godash.Reduce #17

@dineshba

Description

@dineshba

API

input := make(chan int)
var output int

go func() {
    for i := 0; i <= 5; i++ {
        input <- i				
    }
    close(input)
}()

godash.Reduce(input, &output, func(sum , element int) int {
  return sum + element
})

fmt.Println(output)

// Output: 15

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions