InteropEvent

class InteropEvent(val eventName: String, val eventData: WritableMap?, surfaceId: Int, viewTag: Int) : Event<InteropEvent>

An Event class used by the InteropEventEmitter. This class is just holding the event name and the data which is received by the receiveEvent method and will be passed over the the com.facebook.react.uimanager.events.EventDispatcher

Constructors

Link copied to clipboard
constructor(eventName: String, eventData: WritableMap?, surfaceId: Int, viewTag: Int)

Properties

Link copied to clipboard
@get:JvmName(name = "eventData")
val eventData: WritableMap?
Link copied to clipboard
@get:JvmName(name = "eventName")
val eventName: String

Functions

Link copied to clipboard
open fun canCoalesce(): Boolean
Link copied to clipboard
open fun coalesce(otherEvent: InteropEvent): InteropEvent

Given two events, coalesce them into a single event that will be sent to JS instead of two separate events. By default, just chooses the one the is more recent, or this if timestamps are the same.

Link copied to clipboard
open fun dispatch(rctEventEmitter: RCTEventEmitter)

Dispatch this event to JS using the given event emitter. Compatible with old and new renderer. Instead of using this or dispatchModern, it is recommended that you simply override `getEventData`.

Link copied to clipboard
open fun dispatchModern(rctEventEmitter: RCTModernEventEmitter)

Dispatch this event to JS using a V2 EventEmitter. If surfaceId is not -1 and `getEventData` is non-null, this will use the RCTModernEventEmitter API. Otherwise, it falls back to the old-style dispatch function. For Event classes that need to do something different, this method can always be overridden entirely, but it is not recommended.

Link copied to clipboard
Link copied to clipboard
open override fun getEventName(): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getUniqueID(): Int
Link copied to clipboard
Link copied to clipboard
open fun onDispose()

Called when the EventDispatcher is done with an event, either because it was dispatched or because it was coalesced with another Event.