mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 16:59:39 -05:00
Optimized TikTokLiveEventHandler
This commit is contained in:
@@ -53,7 +53,6 @@ public class TikTokLiveEventHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public <T extends TikTokEvent> void unsubscribe(Class<?> clazz, EventConsumer<T> consumer) {
|
public <T extends TikTokEvent> void unsubscribe(Class<?> clazz, EventConsumer<T> consumer) {
|
||||||
if (clazz != null)
|
Optional.ofNullable(clazz).map(events::get).ifPresent(consumers -> consumers.remove(consumer));
|
||||||
Optional.ofNullable(events.get(clazz)).ifPresent(eventConsumers -> eventConsumers.remove(consumer));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user