MCPcopy Create free account
hub / github.com/editablejs/editable / dispatchDiscreteCustomEvent

Function dispatchDiscreteCustomEvent

packages/ui/src/root.tsx:100–102  ·  view source on GitHub ↗

* Flush custom event dispatch * https://github.com/radix-ui/primitives/pull/1378 * * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types. * * Internally, React prioritises events in the following order: * - discrete * - c

(target: E['target'], event: E)

Source from the content-addressed store, hash-verified

98 */
99
100function dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E) {
101 if (target) ReactDOM.flushSync(() => target.dispatchEvent(event))
102}
103
104/* -----------------------------------------------------------------------------------------------*/
105

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…