pinafore/routes/_utils/events.js

19 lines
359 B
JavaScript
Raw Normal View History

2018-01-23 05:47:29 +00:00
export function imgLoadError (node, callback) {
node.addEventListener('error', callback)
return {
teardown () {
node.removeEventListener('error', callback)
}
}
}
export function imgLoad (node, callback) {
node.addEventListener('load', callback)
return {
teardown () {
node.removeEventListener('load', callback)
}
}
}