mirror of
https://github.com/nolanlawson/pinafore
synced 2025-01-09 17:54:20 +01:00
19 lines
359 B
JavaScript
19 lines
359 B
JavaScript
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)
|
|
}
|
|
}
|
|
} |