import { getRoomWatcherTopic, subscribeTopic } from '@amityco/ts-sdk-react-native';
import { useEffect } from 'react';
export const useRoomSubscription = ({
  room
}) => {
  useEffect(() => {
    const unsubscriber = [];
    if (room !== null && room !== void 0 && room.roomId && (room === null || room === void 0 ? void 0 : room.status) !== 'recorded') {
      unsubscriber.push(subscribeTopic(getRoomWatcherTopic(room)));
    }
    return () => unsubscriber.forEach(fn => fn());
  }, [room, room === null || room === void 0 ? void 0 : room.roomId]);
  return null;
};
//# sourceMappingURL=useRoomSubscription.js.map