mirror of
https://github.com/codedread/bitjs
synced 2025-10-03 09:39:16 +02:00
20 lines
446 B
JavaScript
20 lines
446 B
JavaScript
/*
|
|
* parsers.js
|
|
*
|
|
* Common functionality for all image parsers.
|
|
*
|
|
* Licensed under the MIT License
|
|
*
|
|
* Copyright(c) 2024 Google Inc.
|
|
*/
|
|
|
|
/**
|
|
* Creates a new event of the given type with the specified data.
|
|
* @template T
|
|
* @param {string} type The event type.
|
|
* @param {T} data The event data.
|
|
* @return {CustomEvent<T>} The new event.
|
|
*/
|
|
export function createEvent(type, data) {
|
|
return new CustomEvent(type, { detail: data });
|
|
}
|