@@ -25,13 +25,13 @@ export class MdSnackBarRef<T> {
2525 containerInstance : MdSnackBarContainer ;
2626
2727 /** Subject for notifying the user that the snack bar has closed. */
28- private _afterClosed : Subject < any > = new Subject ( ) ;
28+ private _afterClosed = new Subject < void > ( ) ;
2929
3030 /** Subject for notifying the user that the snack bar has opened and appeared. */
31- private _afterOpened : Subject < any > ;
31+ private _afterOpened = new Subject < void > ( ) ;
3232
3333 /** Subject for notifying the user that the snack bar action was called. */
34- private _onAction : Subject < any > = new Subject ( ) ;
34+ private _onAction = new Subject < void > ( ) ;
3535
3636 /**
3737 * Timeout ID for the duration setTimeout call. Used to clear the timeout if the snackbar is
@@ -55,19 +55,19 @@ export class MdSnackBarRef<T> {
5555 clearTimeout ( this . _durationTimeoutId ) ;
5656 }
5757
58- /** Dismisses the snack bar after some duration */
59- _dismissAfter ( duration : number ) : void {
60- this . _durationTimeoutId = setTimeout ( ( ) => this . dismiss ( ) , duration ) ;
61- }
62-
6358 /** Marks the snackbar action clicked. */
64- _action ( ) : void {
59+ closeWithAction ( ) : void {
6560 if ( ! this . _onAction . closed ) {
6661 this . _onAction . next ( ) ;
6762 this . _onAction . complete ( ) ;
6863 }
6964 }
7065
66+ /** Dismisses the snack bar after some duration */
67+ _dismissAfter ( duration : number ) : void {
68+ this . _durationTimeoutId = setTimeout ( ( ) => this . dismiss ( ) , duration ) ;
69+ }
70+
7171 /** Marks the snackbar as opened */
7272 _open ( ) : void {
7373 if ( ! this . _afterOpened . closed ) {
0 commit comments