This commit is contained in:
xing 2023-10-24 16:06:59 +08:00
parent 179545f2bb
commit acbcbf455f

View File

@ -45,12 +45,14 @@ func FlushMapVal[T any](namespace string, key T) {
fn(key) fn(key)
} }
func FlushAnyVal(namespace string) { func FlushAnyVal(namespaces ...string) {
fn, ok := callsM.Load(namespace) for _, namespace := range namespaces {
if !ok { fn, ok := callsM.Load(namespace)
return if !ok {
return
}
fn()
} }
fn()
} }
func GetAnyMapFnBys[K comparable, V, A any](namespace string, fn func(A) V) func(key K, args A) V { func GetAnyMapFnBys[K comparable, V, A any](namespace string, fn func(A) V) func(key K, args A) V {