"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useEventListener = void 0;

var _react = require("react");

var _reactNative = require("react-native");

const useEventListener = (eventName, listener) => {
  (0, _react.useEffect)(() => {
    const eventEmitter = new _reactNative.NativeEventEmitter(_reactNative.NativeModules.SyrfClient);
    const eventListener = eventEmitter.addListener(eventName, listener);
    return () => {
      eventListener.remove();
    };
  }, [eventName, listener]);
};

exports.useEventListener = useEventListener;
//# sourceMappingURL=useEventListener.js.map