mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-24 14:30:09 +08:00
Prefer value class
This commit is contained in:
parent
b7527a1b56
commit
083a3a1e00
@ -31,10 +31,11 @@ internal interface EventDispatcher {
|
||||
companion object : ComponentKey<EventDispatcher>
|
||||
}
|
||||
|
||||
internal inline class EventBroadcastJob(
|
||||
@JvmInline
|
||||
internal value class EventBroadcastJob(
|
||||
private val job: Job
|
||||
) {
|
||||
inline fun successThen(crossinline action: () -> Unit) {
|
||||
inline fun onSuccess(crossinline action: () -> Unit) {
|
||||
job.invokeOnCompletion {
|
||||
if (it == null) action()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user