import { select as o, put as r } from "redux-saga/effects"
import { getCoreBackend as m } from "../../backend"
import { apiSubscribeSaga as i } from "../lib"
import { hasObjChanges as e } from "../lib/object"
import { taskErrorSaga as t } from "../error"
import { parseRoomInfoResponse as f } from "./room.model"
import { setRoomInfo as n } from "./room.action"
import { getRoomItemById as c } from "./room.selector"
export function* subscribeToRoomInfo({ roomId: p, appVersion: s }) {
yield i(
[m().subscribeRoomInfo, p],
function* (m) {
const i = yield o(c(p)),
t = f(m, s)
e(i, t) && (yield r(n(t)))
},
{ onError: (o) => t("subscribeToRoomInfo", o) },
)
}