Interface IEventEmitter
interface IEventEmitter
Extends com.amazon.apmf.IStandard
Emit events to the React Native JavaScript layer.
Methods
emit()
Function to emit event. The function emits the event asynchronously.voidemit(com.amazon.kepler.uitoolkit.view.IView*view,stringname)
Parameters
view
com.amazon.kepler.uitoolkit.view.IView* — Required
View instance on which to emit the event.
name
string — Required
Name of the custom event to emit.
Throws
InvalidKeplerScriptViewError— The provided view root node, must be a valid root node (i.e., one that was previously created frommakeView).
emitWithPayload()
Function to emit event with payload. The function emits the event asynchronously.voidemitWithPayload(com.amazon.kepler.uitoolkit.view.IView*view,stringname,IPayloadDelegate*payloadDelegate)
Parameters
view
com.amazon.kepler.uitoolkit.view.IView* — Required
View instance on which to emit the event.
name
string — Required
Name of the custom event to emit.
payloadDelegate
IPayloadDelegate* — Required
An instance of payloadDelegate.
Throws
InvalidKeplerScriptViewError— The provided view root node, must be a valid root node (i.e., one that was previously created frommakeView).
emitUnique()
Function to emit unique events, if there is already an event in the eventQueue with the given type and target then that event is not emitted, inshort uniqueness is defined by two properties “Type” which is the event name and “event target” which is the corresponding view. The function emits the event asynchronously.voidemitUnique(com.amazon.kepler.uitoolkit.view.IView*view,stringname)
Parameters
view
com.amazon.kepler.uitoolkit.view.IView* — Required
View instance on which to emit the event.
name
string — Required
Name of the custom event to emit.
Throws
InvalidKeplerScriptViewError— The provided view root node, must be a valid root node (i.e., one that was previously created frommakeView).
emitUniqueWithPayload()
Function to emit unique events with payload, if there is already an event in the eventQueue with the given type and event target then that event is not emitted, inshort uniqueness is defined by two properties “Type” which is the event name and “event target” which is the corresponding view. The function emits the event asynchronously.voidemitUniqueWithPayload(com.amazon.kepler.uitoolkit.view.IView*view,stringname,IPayloadDelegate*payloadDelegate)
Parameters
view
com.amazon.kepler.uitoolkit.view.IView* — Required
View instance on which to emit the event.
name
string — Required
Name of the custom event to emit.
payloadDelegate
IPayloadDelegate* — Required
An instance of payloadDelegate.
Throws
InvalidKeplerScriptViewError— The provided view root node, must be a valid root node (i.e., one that was previously created frommakeView).

