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() | |
| shipOrder = this.actions.pipe( | |
| // Отфильтровываем действия отгрузки | |
| ofType<ShipOrder>(ActionTypes.ShipOrder), | |
| // берём данные из действия | |
| map(action => action.payload), | |
| // при поступлении значения payload берём текущее значение имени пользователя из хранилища | |
| withLatestFrom(this.store.pipe(select(getUserName))), | |
| // withLatestFrom возвращает как значение из основного потока payload, так и значение select(getUserName) | |
| map([payload, username] => { | 
  
    
      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({ dispatch: false }) | |
| error = this.actions.pipe( | |
| // отфильтровываем действия ошибок | |
| ofType<ServerError>(ActionTypes.ServerError), | |
| map(({ payload }) => { | |
| // открываем уведомление | |
| this.snackBar.open(payload.message, 'Close'); | |
| }) | |
| ) | 
  
    
      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({ dispatch: false }) | |
| reminder = this.actions.pipe( | |
| // отфильтровываем действия напоминалки | |
| ofType<Reminder>(ActionTypes.Reminder), | |
| map(({ payload }) => { | |
| // открываем уведомление | |
| this.snackBar.openFromComponent(ReminderComponent, { | |
| data: payload, | |
| }); | 
  
    
      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() | |
| openDialog = this.actions.pipe( | |
| // отфильтровываем действие открытия окна | |
| ofType(LoginActionTypes.OpenLoginDialog), | |
| // пропускаем входящие значения пока не завершили обработку текущего значения | |
| exhaustMap(_ => { | |
| // открываем окно | |
| let dialogRef = this.dialog.open(LoginDialog); | |
| // возвращаем обработчик закрытия окна в поток | |
| return dialogRef.afterClosed(); | 
  
    
      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() | |
| breakpoint = this.breakpointObserver | |
| .observe([Breakpoints.HandsetLandscape]) | |
| .pipe( | |
| map(result => result.matches | |
| ? new ChangedToLandscape() | |
| : new ChangedToPortrait()) | |
| ); | 
  
    
      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() | |
| online = merge( | |
| of(navigator.onLine), | |
| fromEvent(window, 'online').pipe(mapTo(true)), | |
| fromEvent(window, 'offline').pipe(mapTo(false)), | |
| ).pipe(map(online => online ? new IsOnline() : new IsOffline())); | 
  
    
      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() | |
| ping = interval(1000).pipe(mapTo(new Ping())); | 
  
    
      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 | |
| @Effect() | |
| getCustomers = this.actions.pipe( | |
| // отфильтруем все действия '[Customers Page] Get' | |
| ofType(CustomerActionTypes.Get), | |
| // стартуем новый асинхронный поток на каждое значение | |
| switchMap(() => | |
| // вызов внешнего сервиса | |
| this.service.get().pipe( | |
| // возвращаем GetCustomersSuccess в случае успеха | 
  
    
      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
    
  
  
    
  | {"lastUpload":"2020-02-19T10:08:23.634Z","extensionVersion":"v3.4.3"} | 
  
    
      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
    
  
  
    
  | // Bonfire: Falsy Bouncer | |
| // Author: @bskydive | |
| // Challenge: http://www.freecodecamp.com/challenges/bonfire-falsy-bouncer# | |
| // Learn to Code at Free Code Camp (www.freecodecamp.com) | |
| function bouncer(arr) { | |
| function filtMe(value){ | |
| var result=false; | |
| //NaN,undefined,null check only this way |