Skip to content

Commit

Permalink
feat: added a simple emitter
Browse files Browse the repository at this point in the history
  • Loading branch information
marksalpeter committed Apr 13, 2021
1 parent 3089fc9 commit 3ab8ad6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions emit.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package util

// Emit fans is out into a channel
func Emit(is ...interface{}) <-chan interface{} {
out := make(chan interface{})
go func() {
defer close(out)
for _, i := range is {
out <- i
}
}()
return out
}

0 comments on commit 3ab8ad6

Please sign in to comment.