added generic types + FilterChanges
This commit is contained in:
4
of.go
4
of.go
@ -56,7 +56,7 @@ func OfFunc[T any](ctx context.Context, buffer int, f func() T) <-chan T {
|
||||
// OfMap returns a channel containing the return values of the unmapper function
|
||||
// applied to any key-value pair in m
|
||||
// The order is random
|
||||
func OfMap[K comparable, V, T any](m map[K]V, unmapper func(K, V) T) <-chan T {
|
||||
func OfMap[K comparable, V, T any](m map[K]V, unmapper MapUnmapper[K, V, T]) <-chan T {
|
||||
out := make(chan T, len(m))
|
||||
|
||||
go func() {
|
||||
@ -85,7 +85,7 @@ func OfSeq[T any](seq iter.Seq[T], buffer int) <-chan T {
|
||||
|
||||
// OfSeq2 returns a channel containing the return values of the unmapper function
|
||||
// when provided with the values of the iterator
|
||||
func OfSeq2[K comparable, V, T any](seq iter.Seq2[K, V], buffer int, unmapper func(K, V) T) <-chan T {
|
||||
func OfSeq2[K comparable, V, T any](seq iter.Seq2[K, V], buffer int, unmapper MapUnmapper[K, V, T]) <-chan T {
|
||||
out := make(chan T, buffer)
|
||||
|
||||
go func() {
|
||||
|
Reference in New Issue
Block a user