onSignal

open var onSignal: (PNSignalResult) -> Unit?

A nullable property for assigning a function or lambda expression to handle incoming signal events. This function is called whenever a new signal is received, providing a convenient way to process or react to signals.

Note that this property allows for the assignment of a singular behavior at a time, as any new assignment will override the previous one. For scenarios requiring multiple behaviors in response to signal events, it is advisable to utilize EventEmitter.addListener.

To deactivate a behavior, assign null to this property.

Setting a Behavior Example:

onSignal = { pnSignalResult ->
println("Received signal: ${pnSignalResult.message}")
}

Removing a Behavior Example:

onSignal = null