Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.map(() =>
Promise.resolve({ type: "connected", serviceID: this.serviceId() }));
const authenticated = Observable
.fromEvent(this.session, CLIENT_EVENTS.RTM.AUTHENTICATED)
.map((e: any) => {
R.forEach((user) => this.storeUsers.set(user.id, user), e.users || []);
R.forEach((channel) => this.storeChannels.set(channel.id, channel),
e.channels || []);
return Promise.resolve({ type: "authenticated", serviceID: this.serviceId() });
});
const disconnected = Observable
.fromEvent(this.session, CLIENT_EVENTS.RTM.DISCONNECT)
.map(() =>
Promise.resolve({ type: "connected", serviceID: this.serviceId() }));
const rateLimited = Observable
.fromEvent(this.session, CLIENT_EVENTS.WEB.RATE_LIMITED)
.map(() =>
Promise.resolve({ type: "rate_limited", serviceID: this.serviceId() }));
return Observable.merge(connected, authenticated, disconnected, rateLimited)
.mergeAll();
}
.map(() =>
Promise.resolve({ type: 'connected', serviceID: this.serviceId() }));
const authenticated = Observable
.fromEvent(this.session, CLIENT_EVENTS.RTM.AUTHENTICATED)
.map((e: any) => {
R.forEach((user: any) => this.storeUsers.set(user.id, user), e.users || []);
R.forEach(
(channel: any) => this.storeChannels.set(channel.id, channel),
e.channels || []);
return Promise.resolve({ type: 'authenticated', serviceID: this.serviceId() });
});
const disconnected = Observable
.fromEvent(this.session, CLIENT_EVENTS.RTM.DISCONNECT)
.map(() => Promise.resolve({ type: 'disconnected', serviceID: this.serviceId() }));
const rateLimited = Observable
.fromEvent(this.session, CLIENT_EVENTS.WEB.RATE_LIMITED)
.map(() => Promise.resolve({ type: 'rate_limited', serviceID: this.serviceId() }));
this.connected = true;
return Observable.merge(connected, authenticated, disconnected, rateLimited)
.mergeAll();
}