Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for channels in godash.Reduce #17

Open
dineshba opened this issue Oct 14, 2019 · 1 comment
Open

Add support for channels in godash.Reduce #17

dineshba opened this issue Oct 14, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@dineshba
Copy link
Member

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
@dineshba dineshba added the enhancement New feature or request label Oct 14, 2019
@snaveen
Copy link

snaveen commented Oct 14, 2019

@dineshba I will work on this enhancement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants