Created
December 13, 2018 04:15
-
-
Save alex-okrushko/c6cce5440d01ab3ab63e8183dfaa6a3b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Effect() | |
| showAddCommentDialog: Observable<Action> = this.actions.pipe( | |
| ofType(actions.SHOW_ADD_COMMENT_DIALOG), | |
| withLatestFrom( | |
| this.store.select(selectors.getCurrentProductId)), | |
| concatMap( | |
| ([{payload}, productId]) => | |
| this.dialog.open(AddCommentDialog, {data: payload}) | |
| .afterClosed() | |
| .pipe( | |
| map(comment => comment ? | |
| new actions.AddComment({comment, productId}) : | |
| new actions.AddCommentDialogCancelled()))), | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment