vscroll
Version:
Virtual scroll engine
23 lines • 816 B
JavaScript
import { BaseAdapterProcessFactory, AdapterProcess, ProcessStatus } from '../misc/index';
export default class Pause extends BaseAdapterProcessFactory(AdapterProcess.pause) {
static run(scroller, options) {
const resume = !!(options === null || options === void 0 ? void 0 : options.resume);
// pause branch
if (!resume && !scroller.state.paused.get()) {
scroller.logger.log('pause scroller');
scroller.state.paused.set(true);
scroller.workflow.call({
process: AdapterProcess.pause,
status: ProcessStatus.done
});
return;
}
scroller.logger.log('resume scroller');
scroller.state.paused.set(false);
scroller.workflow.call({
process: AdapterProcess.pause,
status: ProcessStatus.next
});
}
}
//# sourceMappingURL=pause.js.map