MCPcopy
hub / github.com/Splidejs/splide / fire

Function fire

src/js/test/utils/utils.ts:158–173  ·  view source on GitHub ↗
(
  target: Window | Document | Element,
  type: string,
  data: any = {},
  eventInitDict: EventInit = {}
)

Source from the content-addressed store, hash-verified

156 * @return An event object.
157 */
158export function fire(
159 target: Window | Document | Element,
160 type: string,
161 data: any = {},
162 eventInitDict: EventInit = {}
163): Event {
164 const e = new Event( type, eventInitDict );
165
166 if ( data.timeStamp !== undefined ) {
167 Object.defineProperty( e, 'timeStamp', { value: data.timeStamp } );
168 delete data.timeStamp;
169 }
170
171 target.dispatchEvent( Object.assign( e, data ) );
172 return e;
173}
174
175/**
176 * Emulates keydown.

Callers 15

nearby.test.tsFile · 0.90
sequential.test.tsFile · 0.90
slide.test.tsFile · 0.90
tab.test.tsFile · 0.90
general.test.tsFile · 0.90
move.test.tsFile · 0.90
fireCancelableFunction · 0.90
general.test.tsFile · 0.90
fireCancelableFunction · 0.90
button.test.tsFile · 0.90
autoToggle.test.tsFile · 0.90
isBusy.test.tsFile · 0.90

Calls

no outgoing calls

Tested by 3

fireCancelableFunction · 0.72
fireCancelableFunction · 0.72
fireCancelableFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…