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

Function dispatchDiscreteCustomEvent

packages/ui/src/utils.ts:53–58  ·  view source on GitHub ↗
(
  target: E['target'],
  event: E,
)

Source from the content-addressed store, hash-verified

51 * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
52 */
53export const dispatchDiscreteCustomEvent = <E extends CustomEvent>(
54 target: E['target'],
55 event: E,
56) => {
57 if (target) ReactDOM.flushSync(() => target.dispatchEvent(event))
58}
59
60export const useIsomorphicLayoutEffect =
61 typeof window !== 'undefined' && typeof window.document !== 'undefined'

Callers 2

handleSelectFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…