Skip to content

Instantly share code, notes, and snippets.

@alex-okrushko
Created December 13, 2018 04:15
Show Gist options
  • Select an option

  • Save alex-okrushko/c6cce5440d01ab3ab63e8183dfaa6a3b to your computer and use it in GitHub Desktop.

Select an option

Save alex-okrushko/c6cce5440d01ab3ab63e8183dfaa6a3b to your computer and use it in GitHub Desktop.
@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