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';
|
||||
import { Expression } from 'estree';
|
||||
|
||||
export default function add_event_handlers(
|
||||
block: Block,
|
||||
target: string | Expression,
|
||||
handlers: EventHandler[]
|
||||
) {
|
||||
handlers.forEach((handler) => add_event_handler(block, target, handler));
|
||||
/**
|
||||
* @param {import('../../Block.js').default} block
|
||||
* @param {string | import('estree').Expression} target
|
||||
* @param {import('../Element/EventHandler.js').default[]} handlers
|
||||
*/
|
||||
export default function add_event_handlers(block, target, handlers) {
|
||||
handlers.forEach((handler) => add_event_handler(block, target, handler));
|
||||
}
|
||||
|
||||
export function add_event_handler(
|
||||
block: Block,
|
||||
target: string | Expression,
|
||||
handler: EventHandler
|
||||
) {
|
||||
handler.render(block, target);
|
||||
/**
|
||||
* @param {import('../../Block.js').default} block
|
||||
* @param {string | import('estree').Expression} target
|
||||
* @param {import('../Element/EventHandler.js').default} handler
|
||||
*/
|
||||
export function add_event_handler(block, target, handler) {
|
||||
handler.render(block, target);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in new issue