/**
 * DevExtreme (esm/renovation/utils/subscribe_to_event.js)
 * Version: 21.1.7 (build 22012-0313)
 * Build date: Wed Jan 12 2022
 *
 * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import eventsEngine from "../../events/core/events_engine";
import * as clickEvent from "../../events/click";
export function subscribeToEvent(eventName) {
    return (element, handler) => {
        if (handler && element) {
            eventsEngine.on(element, eventName, handler);
            return () => eventsEngine.off(element, eventName, handler)
        }
        return
    }
}
export var subscribeToClickEvent = subscribeToEvent(clickEvent.name);
export var subscribeToScrollEvent = subscribeToEvent("scroll");
