mirror of https://github.com/sveltejs/svelte
pull/8569/head
parent
20a36b5ef2
commit
9c98b7ca1f
@ -1,19 +1,21 @@
|
|||||||
import Block from '../../Block';
|
/**
|
||||||
import EventHandler from '../Element/EventHandler';
|
* @param {import('../../Block.js').default} block
|
||||||
import { Expression } from 'estree';
|
* @param {string | import('estree').Expression} target
|
||||||
|
* @param {import('../Element/EventHandler.js').default[]} handlers
|
||||||
export default function add_event_handlers(
|
*/
|
||||||
block: Block,
|
export default function add_event_handlers(block, target, handlers) {
|
||||||
target: string | Expression,
|
handlers.forEach((handler) => add_event_handler(block, target, handler));
|
||||||
handlers: EventHandler[]
|
|
||||||
) {
|
|
||||||
handlers.forEach((handler) => add_event_handler(block, target, handler));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function add_event_handler(
|
/**
|
||||||
block: Block,
|
* @param {import('../../Block.js').default} block
|
||||||
target: string | Expression,
|
* @param {string | import('estree').Expression} target
|
||||||
handler: EventHandler
|
* @param {import('../Element/EventHandler.js').default} handler
|
||||||
) {
|
*/
|
||||||
handler.render(block, target);
|
export function add_event_handler(block, target, handler) {
|
||||||
|
handler.render(block, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in new issue