stream-chat-react-native-core
Version:
The official React Native and Expo components for Stream Chat, a service for building chat applications
27 lines • 1.26 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getChannelActiveLocations = void 0;
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _selectActiveLocationsForChannels = require("./queries/selectActiveLocationsForChannels");
var _mapStorableToSharedLocation = require("../mappers/mapStorableToSharedLocation");
var getChannelActiveLocations = exports.getChannelActiveLocations = function () {
var _ref = (0, _asyncToGenerator2.default)(function* ({
channelIds
}) {
var cidVsLiveLocations = {};
var locations = yield (0, _selectActiveLocationsForChannels.selectActiveLocationsForChannels)(channelIds);
locations.forEach(location => {
if (!cidVsLiveLocations[location.channelCid]) {
cidVsLiveLocations[location.channelCid] = [];
}
cidVsLiveLocations[location.channelCid].push((0, _mapStorableToSharedLocation.mapStorableToSharedLocation)(location));
});
return cidVsLiveLocations;
});
return function getChannelActiveLocations(_x) {
return _ref.apply(this, arguments);
};
}();
//# sourceMappingURL=getChannelActiveLocations.js.map