Created
May 13, 2021 16:39
-
-
Save tanmatra/e383d40dcabe2b90000b3b5a9ecb5cfd to your computer and use it in GitHub Desktop.
IDEA with Kotlin plugin freeze
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example | |
class DataChannel { | |
fun registerObserver(dataChannelObserver: DataChannelObserver?) {} | |
} | |
interface DataChannelObserver { | |
fun onStateChange() | |
} | |
class Player | |
{ | |
suspend fun startAsync(dataChannel: DataChannel) { | |
dataChannel.registerObserver(object : DataChannelObserver { | |
override fun onStateChange() { | |
println("onStateChange: $") // place cursor after $ and type { | |
} | |
}) | |
println("Observer registered: ${dataChannel.toString()}") // .toString() here is intentional | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment