func NewDebounceArray() (*DebounceArray, chan error) {
	ch := make(chan error, 1)
	return &DebounceArray{array: []chan error{}}, ch
}
NewDebounceArray creates a new debounce array object
package utils
import "sync"
type Debounce struct {
	serviceLocks sync.Map
}
func NewDebounce() *Debounce {
	return &Debounce{}
}
func (d *Debounce) Wait(key string, cb func() error) error {
	emptyArray, ch := NewDebounceArray()
	tempArray, _ := d.serviceLocks.LoadOrStore(key, emptyArray)
	array := tempArray.(*DebounceArray)
	size := array.Add(ch)
	if size == 1 {
		array.Notify(cb())
		d.serviceLocks.Delete(key)
	}
	return <-ch
}
type DebounceArray struct {
	lock  sync.Mutex
	array []chan error
}