mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-24 06:50:08 +08:00
Inline ListenerBuilder
This commit is contained in:
parent
b797ef3cc1
commit
361c0d4f03
@ -136,9 +136,8 @@ suspend inline fun <reified E : Subscribable> subscribeAll(noinline listeners: s
|
||||
*/
|
||||
@ListenersBuilderDsl
|
||||
@Suppress("MemberVisibilityCanBePrivate", "unused")
|
||||
class ListenerBuilder<out E : Subscribable>(
|
||||
@PublishedApi
|
||||
internal val handlerConsumer: suspend (Listener<E>) -> Unit
|
||||
inline class ListenerBuilder<out E : Subscribable>(
|
||||
@PublishedApi internal inline val handlerConsumer: suspend (Listener<E>) -> Unit
|
||||
) {
|
||||
suspend inline fun handler(noinline listener: suspend (E) -> ListeningStatus) {
|
||||
handlerConsumer(Handler(listener))
|
||||
|
Loading…
Reference in New Issue
Block a user