support both destroy and teardown in custom event handlers

pull/1294/head
ekhaled 7 years ago
parent 78f506a50b
commit b8c0ab2949

@ -517,7 +517,7 @@ export default class Element extends Node {
`); `);
block.builders.destroy.addLine(deindent` block.builders.destroy.addLine(deindent`
${handlerName}.teardown(); ${handlerName}[${handlerName}.destroy ? 'destroy' : 'teardown']();
`); `);
} else { } else {
const handler = deindent` const handler = deindent`

@ -212,7 +212,7 @@ function create_main_fragment(component, state) {
}, },
d: function destroy$$1() { d: function destroy$$1() {
foo_handler.teardown(); foo_handler[foo_handler.destroy ? 'destroy' : 'teardown']();
} }
}; };
} }

@ -39,7 +39,7 @@ function create_main_fragment(component, state) {
}, },
d: function destroy() { d: function destroy() {
foo_handler.teardown(); foo_handler[foo_handler.destroy ? 'destroy' : 'teardown']();
} }
}; };
} }

Loading…
Cancel
Save