blob: d1068e35d621cd022a4af6499b0999919336d797 [file] [log] [blame]
import { NodeMutation } from '../../../presentation/nodeWatcher/NodeWatcherHandler';
import CCInfiniteScroll from '../core/ccInfiniteScroll';
import CssSelectorNodeWatcherHandler from '../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
export default class CCInfiniteScrollLoadMoreBarHandler extends CssSelectorNodeWatcherHandler {
cssSelector = '.load-more-bar';
constructor(private ccInfiniteScroll: CCInfiniteScroll) {
super();
}
onMutatedNode({ node }: NodeMutation) {
if (!(node instanceof Element)) {
console.error(
'[CCInfiniteScrollLoadMoreBarHandler] Node is not an Element: ',
node,
);
return;
}
this.ccInfiniteScroll.observeLoadMoreBar(node);
}
}