Gene documentation
Components
Dispatch API

Dispatch API

The dispatch method accepts two arguments:

dispatch(eventTarget, eventTuple)

where:

ParameterDescription
eventTargetThe target element of the dispatched event, typically e.target.
eventTupleAn array containing [eventName, eventPayload].

Example Usage

const eventPayload = {
  id: '1234'
}
 
<button
  onClick={(e) => dispatch(e.target, ['myCustomEventName', eventPayload])}
>
  Click me!
</button>