Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.subscribe((connectionStatus) => {
this.conectionStatus = connectionStatus;
switch (connectionStatus) {
case ConnectionStatus.Uninitialized:
// the status when the DirectLine object is first created/constructed
break;
case ConnectionStatus.Connecting:
// currently trying to connect to the conversation
if (program.verbose) {
console.log('Connecting to DirectLine...');
}
break;
case ConnectionStatus.Online:
// successfully connected to the converstaion. Connection is healthy so far as we know.
if (program.verbose) {
console.log('Connected to DirectLine.');
}
if (this.onReadyCb) {
this.onReadyCb();
}
connectionStatus$: new Observable(observer => {
observer.next(ConnectionStatus.Uninitialized);
observer.next(ConnectionStatus.Connecting);
observer.next(ConnectionStatus.Online);
}),
activity$: new Observable(observer => {
export const connection: Reducer = (
state: ConnectionState = {
connectionStatus: ConnectionStatus.Uninitialized,
botConnection: undefined,
selectedActivity: undefined,
user: undefined,
bot: undefined
},
action: ConnectionAction
) => {
switch (action.type) {
case 'Start_Connection':
return {
...state,
botConnection: action.botConnection,
user: action.user,
bot: action.bot,
selectedActivity: action.selectedActivity
};