blob: c776588dd55bf9951a8ab75a647fabf46598c9c9 [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);
}
}