separate variable constants

This commit is contained in:
Harvey committed 2022-04-27 10:42:07 +08:00
1 parent 57a14f63ac
commit fc3abd7d1d
20 files changed
+143 -80

No files matched your search

+3 -2
View File
@@ -3,12 +3,13 @@ import { throttle, isInViewport } from '../utils';
export default function viewInit(art, events) {
const {
option,
constructor,
template: { $container },
} = art;
const scrollFn = throttle(() => {
art.emit('view', isInViewport($container, 50));
}, 200);
art.emit('view', isInViewport($container, constructor.SCROLL_GAP));
}, constructor.SCROLL_TIME);
events.proxy(window, 'scroll', () => {
scrollFn();