UNPKG

@sendbird/calls-react-native

Version:

Sendbird Calls SDK for React Native: Empower React Native apps with seamless audio, video, and group calling. Build interactive communication easily.

43 lines (42 loc) 1.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RoomListQuery = exports.DirectCallLogListQuery = exports.BridgedQuery = void 0; function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } class BridgedQuery { get isLoading() { return this._isLoading; } get hasNext() { return this._hasNext; } constructor(queryKey, type, binder) { this.queryKey = queryKey; this.type = type; this.binder = binder; _defineProperty(this, "_isLoading", false); _defineProperty(this, "_hasNext", false); } async next() { this._isLoading = true; const { hasNext, result } = await this.binder.nativeModule.queryNext(this.queryKey, this.type); this._hasNext = hasNext; this._isLoading = false; return result; } release() { this.binder.nativeModule.queryRelease(this.queryKey); } } exports.BridgedQuery = BridgedQuery; class DirectCallLogListQuery extends BridgedQuery {} exports.DirectCallLogListQuery = DirectCallLogListQuery; class RoomListQuery extends BridgedQuery {} exports.RoomListQuery = RoomListQuery; //# sourceMappingURL=BridgedQuery.js.map