Add MultiCookie to make theming easier

This commit is contained in:
Sasha Koshka 2023-08-07 21:56:28 -04:00
parent 9d40ab654a
commit e63ebdb89e
1 changed files with 14 additions and 0 deletions

View File

@ -65,3 +65,17 @@ func (broadcaster *FuncBroadcaster) Broadcast () {
listener()
}
}
type multiCookie []Cookie
// MultiCookie creates a single cookie that, when closed, closes a list of other
// cookies.
func MultiCookie (cookies ...Cookie) Cookie {
return multiCookie(cookies)
}
func (cookies multiCookie) Close () {
for _, cookie := range cookies {
cookie.Close()
}
}