How to use the @ngxs/store.ofActionCompleted function in @ngxs/store

To help you get started, we’ve selected a few @ngxs/store examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github phucan1108 / letportal / src / web-portal / src / app / modules / portal / modules / chat / components / chat-warpper / chat-wrapper.component.ts View on Github external
ngOnInit(): void {
        
        this.sup.add(this.actions$.pipe(
            ofActionCompleted(GotHubChatProblem)
        ).subscribe(() => {
            // Display error about chat server's problem
        }))
        this.sup.add(
            this.actions$.pipe(
                ofActionSuccessful(ActiveDoubleChatRoom),
            ).subscribe(
                () => {
                    if(!this.isShowChatBox)
                        this.isShowChatBox = true
                }
            )
        )
        this.sup.add(this.chatState$.pipe(
            filter(state => ObjectUtils.isNotNull(state.currentUser)),
            tap(
github phucan1108 / letportal / src / web-portal / src / app / modules / portal / modules / chat / components / video-call-dialog / video-call-dialog.component.ts View on Github external
)
        )

        this.sup.add(
            this.action$.pipe(
                ofActionCompleted(DroppedCall)
            ).subscribe(
                () => {
                    this.closed()
                }
            )
        )

        this.sup.add(
            this.action$.pipe(
                ofActionCompleted(UserCancelledCall)
            ).subscribe(
                () => {
                    // Caller is cancelled a call when he is dialing
                    // So we drop the call as well  
                    this.shortcutUtil.toastMessage('User ended a call', ToastType.Warning)
                    this.store.dispatch(new DroppedCall())
                    this.dialogRef.close()
                }
            )
        )
    }
github phucan1108 / letportal / src / web-portal / src / app / modules / portal / modules / chat / components / video-call-dialog / video-call-dialog.component.ts View on Github external
)

        this.sup.add(
            this.action$.pipe(
                ofActionCompleted(UserDroppedCall)
            ).subscribe(
                () => {
                    this.allowDisplayToastError = false
                    this.closed()
                }
            )
        )

        this.sup.add(
            this.action$.pipe(
                ofActionCompleted(DroppedCall)
            ).subscribe(
                () => {
                    this.closed()
                }
            )
        )

        this.sup.add(
            this.action$.pipe(
                ofActionCompleted(UserCancelledCall)
            ).subscribe(
                () => {
                    // Caller is cancelled a call when he is dialing
                    // So we drop the call as well  
                    this.shortcutUtil.toastMessage('User ended a call', ToastType.Warning)
                    this.store.dispatch(new DroppedCall())
github phucan1108 / letportal / src / web-portal / src / app / modules / portal / modules / chat / components / video-stream-dialog / video-stream-dialog.component.ts View on Github external
).subscribe(
                () => {
                    this.iceServers = this.store.selectSnapshot(CHAT_STATE_TOKEN).iceServers
                    this.initRtcConnect(
                        this.iceServers,
                        this.handshakedRoom.id,
                        this.handshakedRoom.participants.find(a => a.username === this.invitee.userName).connectionId
                    )
                }
            )
        )


        this.sup.add(
            this.actions$.pipe(
                ofActionCompleted(UserDroppedCall)
            ).subscribe(
                () => {
                    this.shortcutUtil.toastMessage(this.translate.instant('chats.videoCall.messages.userEndCall'), ToastType.Warning)
                    this.dropAll()
                }
            )
        )
    }
github ngxs / ngxs-examples / projects / wiki-search / src / app / wiki-article / content-component / content.component.ts View on Github external
private subscribeToActionCompleted(): void {
    this.actions$
      .pipe(
        ofActionCompleted(LoadContent),
        takeUntil(this.unsubscriber$)
      )
      .subscribe(() => {
        this.inProgress = false;
      });
  }
github phucan1108 / letportal / src / web-portal / src / app / modules / portal / modules / chat / components / video-call-dialog / video-call-dialog.component.ts View on Github external
this.action$.pipe(
                ofActionSuccessful(UserDeniedCall)
            ).subscribe(
                () => {
                    clearInterval(this.animationInterval)
                    if (this.allowDisplayToastError) {
                        this.shortcutUtil.toastMessage('User rejected a call', ToastType.Warning)
                    }
                    this.store.dispatch(new DroppedCall())
                    this.dialogRef.close()
                })
        )

        this.sup.add(
            this.action$.pipe(
                ofActionCompleted(UserDroppedCall)
            ).subscribe(
                () => {
                    this.allowDisplayToastError = false
                    this.closed()
                }
            )
        )

        this.sup.add(
            this.action$.pipe(
                ofActionCompleted(DroppedCall)
            ).subscribe(
                () => {
                    this.closed()
                }
            )