add lazyload

This commit is contained in:
Harvey Zack committed 2018-10-22 11:10:57 +08:00
1 parent 8b6258c4e5
commit a26afec5ac
4 files changed
+68 -18

No files matched your search

+2 -7
View File
@@ -11,14 +11,9 @@ export default class Events {
}
target.addEventListener(name, callback, option);
const destroy = () => {
this.destroyEvents.push(() => {
target.removeEventListener(name, callback, option);
};
this.destroyEvents.push(destroy);
return destroy;
});
}
destroy() {