mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 11:41:08 +00:00
Added an extremely simple `.editorconfig` I inferred from the main part of the project, then reformatted the codebase according to it. 🙂
27 lines
766 B
Kotlin
27 lines
766 B
Kotlin
package com.reactnativecommunity.webview.events
|
|
|
|
import com.facebook.react.bridge.Arguments
|
|
import com.facebook.react.uimanager.events.Event
|
|
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
|
|
/**
|
|
* Event emitted when there is an error in loading.
|
|
*/
|
|
class TopMessageEvent(viewId: Int, private val mData: String) : Event<TopMessageEvent>(viewId) {
|
|
companion object {
|
|
const val EVENT_NAME = "topMessage"
|
|
}
|
|
|
|
override fun getEventName(): String = EVENT_NAME
|
|
|
|
override fun canCoalesce(): Boolean = false
|
|
|
|
override fun getCoalescingKey(): Short = 0
|
|
|
|
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
|
|
val data = Arguments.createMap()
|
|
data.putString("data", mData)
|
|
rctEventEmitter.receiveEvent(viewTag, EVENT_NAME, data)
|
|
}
|
|
}
|