rxjs 6.0.0 compatibility

This commit is contained in:
Sercan Yemen 2018-05-09 17:55:26 +03:00
parent d330b42dec
commit 5ce276de8e
78 changed files with 256 additions and 301 deletions

View File

@ -1,6 +1,7 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/interval'; import { interval } from 'rxjs';
import { map } from 'rxjs/operators';
import * as moment from 'moment'; import * as moment from 'moment';
@ -31,22 +32,21 @@ export class FuseCountdownComponent implements OnInit
let diff = eventDate.diff(currDate, 'seconds'); let diff = eventDate.diff(currDate, 'seconds');
const countDown = const countDown = interval(1000).pipe(
Observable map(value => {
.interval(1000) return diff = diff - 1;
.map(value => { }),
return diff = diff - 1; map(value => {
}) const timeLeft = moment.duration(value, 'seconds');
.map(value => {
const timeLeft = moment.duration(value, 'seconds');
return { return {
days : timeLeft.asDays().toFixed(0), days : timeLeft.asDays().toFixed(0),
hours : timeLeft.hours(), hours : timeLeft.hours(),
minutes: timeLeft.minutes(), minutes: timeLeft.minutes(),
seconds: timeLeft.seconds() seconds: timeLeft.seconds()
}; };
}); })
);
countDown.subscribe(value => { countDown.subscribe(value => {
this.countdown = value; this.countdown = value;

View File

@ -1,7 +1,8 @@
import { Component, HostBinding, HostListener, Input, OnDestroy } from '@angular/core'; import { Component, HostBinding, HostListener, Input, OnDestroy } from '@angular/core';
import { Subscription } from 'rxjs';
import { fuseAnimations } from '../../../../animations/index'; import { fuseAnimations } from '../../../../animations/index';
import { FuseConfigService } from '../../../../services/config.service'; import { FuseConfigService } from '../../../../services/config.service';
import { Subscription } from 'rxjs/Subscription';
@Component({ @Component({
selector : 'fuse-nav-horizontal-collapse', selector : 'fuse-nav-horizontal-collapse',

View File

@ -1,5 +1,5 @@
import { EventEmitter, Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject'; import { Subject } from 'rxjs';
@Injectable() @Injectable()
export class FuseNavigationService export class FuseNavigationService

View File

@ -1,5 +1,5 @@
import { Component, EventEmitter, Output } from '@angular/core'; import { Component, EventEmitter, Output } from '@angular/core';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { FuseConfigService } from '@fuse/services/config.service'; import { FuseConfigService } from '@fuse/services/config.service';

View File

@ -1,6 +1,7 @@
import { Component, ElementRef, Input, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core'; import { Component, ElementRef, Input, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { ObservableMedia } from '@angular/flex-layout'; import { ObservableMedia } from '@angular/flex-layout';
import { Subscription } from 'rxjs';
import { CookieService } from 'ngx-cookie-service'; import { CookieService } from 'ngx-cookie-service';
import { FuseMatchMediaService } from '@fuse/services/match-media.service'; import { FuseMatchMediaService } from '@fuse/services/match-media.service';

View File

@ -1,7 +1,7 @@
import { Component, ElementRef, HostBinding, HostListener, Input, OnDestroy, OnInit, Renderer2, ViewEncapsulation } from '@angular/core'; import { Component, ElementRef, HostBinding, HostListener, Input, OnDestroy, OnInit, Renderer2, ViewEncapsulation } from '@angular/core';
import { animate, AnimationBuilder, AnimationPlayer, style } from '@angular/animations'; import { animate, AnimationBuilder, AnimationPlayer, style } from '@angular/animations';
import { ObservableMedia } from '@angular/flex-layout'; import { ObservableMedia } from '@angular/flex-layout';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { FuseSidebarService } from './sidebar.service'; import { FuseSidebarService } from './sidebar.service';
import { FuseMatchMediaService } from '@fuse/services/match-media.service'; import { FuseMatchMediaService } from '@fuse/services/match-media.service';

View File

@ -1,6 +1,6 @@
import { Component, ElementRef, HostBinding, Input, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core'; import { Component, ElementRef, HostBinding, Input, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
import { style, animate, AnimationBuilder, AnimationPlayer } from '@angular/animations'; import { style, animate, AnimationBuilder, AnimationPlayer } from '@angular/animations';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';
import { FuseConfigService } from '@fuse/services/config.service'; import { FuseConfigService } from '@fuse/services/config.service';

View File

@ -1,7 +1,7 @@
import { Directive, Input, OnInit, HostListener, OnDestroy, HostBinding } from '@angular/core'; import { Directive, Input, OnInit, HostListener, OnDestroy, HostBinding } from '@angular/core';
import { MatSidenav } from '@angular/material'; import { MatSidenav } from '@angular/material';
import { ObservableMedia } from '@angular/flex-layout'; import { ObservableMedia } from '@angular/flex-layout';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { FuseMatchMediaService } from '@fuse/services/match-media.service'; import { FuseMatchMediaService } from '@fuse/services/match-media.service';
import { FuseMatSidenavHelperService } from '@fuse/directives/fuse-mat-sidenav/fuse-mat-sidenav.service'; import { FuseMatSidenavHelperService } from '@fuse/directives/fuse-mat-sidenav/fuse-mat-sidenav.service';

View File

@ -1,6 +1,6 @@
import { AfterViewInit, Directive, ElementRef, HostListener, OnDestroy, OnInit } from '@angular/core'; import { AfterViewInit, Directive, ElementRef, HostListener, OnDestroy, OnInit } from '@angular/core';
import { Platform } from '@angular/cdk/platform'; import { Platform } from '@angular/cdk/platform';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import PerfectScrollbar from 'perfect-scrollbar'; import PerfectScrollbar from 'perfect-scrollbar';

View File

@ -1,7 +1,8 @@
import { Inject, Injectable, InjectionToken } from '@angular/core'; import { Inject, Injectable, InjectionToken } from '@angular/core';
import { NavigationEnd, NavigationStart, Router } from '@angular/router'; import { NavigationEnd, NavigationStart, Router } from '@angular/router';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Platform } from '@angular/cdk/platform'; import { Platform } from '@angular/cdk/platform';
import { BehaviorSubject } from 'rxjs';
import * as _ from 'lodash'; import * as _ from 'lodash';
// Create the injection token for the custom config // Create the injection token for the custom config

View File

@ -1,6 +1,6 @@
import { MediaChange, ObservableMedia } from '@angular/flex-layout'; import { MediaChange, ObservableMedia } from '@angular/flex-layout';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { BehaviorSubject } from 'rxjs';
@Injectable() @Injectable()
export class FuseMatchMediaService export class FuseMatchMediaService

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable() @Injectable()
export class AcademyCourseService implements Resolve<any> export class AcademyCourseService implements Resolve<any>

View File

@ -1,5 +1,5 @@
import { AfterViewInit, ChangeDetectorRef, Component, OnDestroy, OnInit, QueryList, ViewChildren, ViewEncapsulation } from '@angular/core'; import { AfterViewInit, ChangeDetectorRef, Component, OnDestroy, OnInit, QueryList, ViewChildren, ViewEncapsulation } from '@angular/core';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive'; import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable() @Injectable()
export class AcademyCoursesService implements Resolve<any> export class AcademyCoursesService implements Resolve<any>

View File

@ -1,5 +1,5 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';

View File

@ -1,9 +1,8 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { Subject } from 'rxjs/Subject';
import { MatDialog, MatDialogRef } from '@angular/material'; import { MatDialog, MatDialogRef } from '@angular/material';
import { Subject } from 'rxjs';
import { startOfDay, isSameDay, isSameMonth } from 'date-fns'; import { startOfDay, isSameDay, isSameMonth } from 'date-fns';
import { CalendarEvent, CalendarEventAction, CalendarEventTimesChangedEvent, CalendarMonthViewDay } from 'angular-calendar'; import { CalendarEvent, CalendarEventAction, CalendarEventTimesChangedEvent, CalendarMonthViewDay } from 'angular-calendar';
import { FuseConfirmDialogComponent } from '@fuse/components/confirm-dialog/confirm-dialog.component'; import { FuseConfirmDialogComponent } from '@fuse/components/confirm-dialog/confirm-dialog.component';

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable, Subject } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
@Injectable() @Injectable()
export class CalendarService implements Resolve<any> export class CalendarService implements Resolve<any>

View File

@ -1,10 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { FuseUtils } from '@fuse/utils'; import { FuseUtils } from '@fuse/utils';

View File

@ -1,7 +1,6 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms'; import { FormControl, FormGroup } from '@angular/forms';
import 'rxjs/add/operator/debounceTime'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import 'rxjs/add/operator/distinctUntilChanged';
import { ChatService } from '../../../chat.service'; import { ChatService } from '../../../chat.service';
@ -27,14 +26,14 @@ export class FuseChatUserSidenavComponent implements OnInit, OnDestroy
ngOnInit() ngOnInit()
{ {
this.onFormChange = this.userForm.valueChanges this.onFormChange = this.userForm.valueChanges.pipe(
.debounceTime(500) debounceTime(500),
.distinctUntilChanged() distinctUntilChanged()
.subscribe(data => { ).subscribe(data => {
this.user.mood = data.mood; this.user.mood = data.mood;
this.user.status = data.status; this.user.status = data.status;
this.chatService.updateUserData(this.user); this.chatService.updateUserData(this.user);
}); });
} }
changeLeftSidenavView(view) changeLeftSidenavView(view)

View File

@ -2,8 +2,7 @@ import { Component, OnDestroy, OnInit, TemplateRef, ViewChild, ViewEncapsulation
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { MatDialog, MatDialogRef } from '@angular/material'; import { MatDialog, MatDialogRef } from '@angular/material';
import { DataSource } from '@angular/cdk/collections'; import { DataSource } from '@angular/cdk/collections';
import { Subscription } from 'rxjs/Subscription'; import { Observable, Subscription } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';
import { FuseConfirmDialogComponent } from '@fuse/components/confirm-dialog/confirm-dialog.component'; import { FuseConfirmDialogComponent } from '@fuse/components/confirm-dialog/confirm-dialog.component';

View File

@ -1,10 +1,10 @@
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms'; import { FormControl, FormGroup } from '@angular/forms';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import { Subscription } from 'rxjs/Subscription';
import { MatDialog } from '@angular/material'; import { MatDialog } from '@angular/material';
import { Subscription } from 'rxjs';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';
import { FuseContactsContactFormDialogComponent } from './contact-form/contact-form.component'; import { FuseContactsContactFormDialogComponent } from './contact-form/contact-form.component';
@ -63,8 +63,10 @@ export class FuseContactsComponent implements OnInit, OnDestroy
}); });
this.searchInput.valueChanges this.searchInput.valueChanges
.debounceTime(300) .pipe(
.distinctUntilChanged() debounceTime(300),
distinctUntilChanged()
)
.subscribe(searchText => { .subscribe(searchText => {
this.contactsService.onSearchTextChanged.next(searchText); this.contactsService.onSearchTextChanged.next(searchText);
}); });

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable'; import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Subject } from 'rxjs/Subject';
import { FuseUtils } from '@fuse/utils'; import { FuseUtils } from '@fuse/utils';

View File

@ -1,5 +1,5 @@
import { Component, OnDestroy } from '@angular/core'; import { Component, OnDestroy } from '@angular/core';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { ContactsService } from '../../contacts.service'; import { ContactsService } from '../../contacts.service';

View File

@ -1,8 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
@Injectable() @Injectable()
export class AnalyticsDashboardService implements Resolve<any> export class AnalyticsDashboardService implements Resolve<any>

View File

@ -1,7 +1,7 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { DataSource } from '@angular/cdk/collections'; import { DataSource } from '@angular/cdk/collections';
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import * as shape from 'd3-shape'; import * as shape from 'd3-shape';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';

View File

@ -1,8 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
@Injectable() @Injectable()
export class ProjectDashboardService implements Resolve<any> export class ProjectDashboardService implements Resolve<any>

View File

@ -1,8 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
@Injectable() @Injectable()
export class EcommerceDashboardService implements Resolve<any> export class EcommerceDashboardService implements Resolve<any>

View File

@ -1,12 +1,6 @@
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms'; import { FormBuilder, FormGroup } from '@angular/forms';
import 'rxjs/add/operator/startWith'; import { Subscription } from 'rxjs';
import 'rxjs/add/observable/merge';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/observable/fromEvent';
import { Subscription } from 'rxjs/Subscription';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable() @Injectable()
export class EcommerceOrderService implements Resolve<any> export class EcommerceOrderService implements Resolve<any>

View File

@ -1,14 +1,9 @@
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { MatPaginator, MatSort } from '@angular/material'; import { MatPaginator, MatSort } from '@angular/material';
import { DataSource } from '@angular/cdk/collections'; import { DataSource } from '@angular/cdk/collections';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { merge, Observable, BehaviorSubject, fromEvent } from 'rxjs';
import 'rxjs/add/operator/startWith'; import { debounceTime, distinctUntilChanged, map } from 'rxjs/operators';
import 'rxjs/add/observable/merge';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/observable/fromEvent';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';
import { FuseUtils } from '@fuse/utils'; import { FuseUtils } from '@fuse/utils';
@ -40,16 +35,16 @@ export class FuseEcommerceOrdersComponent implements OnInit
{ {
this.dataSource = new FilesDataSource(this.ordersService, this.paginator, this.sort); this.dataSource = new FilesDataSource(this.ordersService, this.paginator, this.sort);
Observable.fromEvent(this.filter.nativeElement, 'keyup') fromEvent(this.filter.nativeElement, 'keyup').pipe(
.debounceTime(150) debounceTime(150),
.distinctUntilChanged() distinctUntilChanged()
.subscribe(() => { ).subscribe(() => {
if ( !this.dataSource ) if ( !this.dataSource )
{ {
return; return;
} }
this.dataSource.filter = this.filter.nativeElement.value; this.dataSource.filter = this.filter.nativeElement.value;
}); });
} }
} }
@ -97,19 +92,22 @@ export class FilesDataSource extends DataSource<any>
this._filterChange, this._filterChange,
this._sort.sortChange this._sort.sortChange
]; ];
return Observable.merge(...displayDataChanges).map(() => {
let data = this.ordersService.orders.slice();
data = this.filterData(data); return merge(...displayDataChanges).pipe(map(() => {
this.filteredData = [...data]; let data = this.ordersService.orders.slice();
data = this.sortData(data); data = this.filterData(data);
// Grab the page's slice of data. this.filteredData = [...data];
const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
return data.splice(startIndex, this._paginator.pageSize); data = this.sortData(data);
});
// Grab the page's slice of data.
const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
return data.splice(startIndex, this._paginator.pageSize);
})
);
} }

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable() @Injectable()
export class EcommerceOrdersService implements Resolve<any> export class EcommerceOrdersService implements Resolve<any>

View File

@ -1,14 +1,7 @@
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms'; import { FormBuilder, FormGroup } from '@angular/forms';
import { MatSnackBar } from '@angular/material'; import { MatSnackBar } from '@angular/material';
import { Subscription } from 'rxjs';
import 'rxjs/add/operator/startWith';
import 'rxjs/add/observable/merge';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/observable/fromEvent';
import { Subscription } from 'rxjs/Subscription';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';
import { FuseUtils } from '@fuse/utils'; import { FuseUtils } from '@fuse/utils';

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable() @Injectable()
export class EcommerceProductService implements Resolve<any> export class EcommerceProductService implements Resolve<any>

View File

@ -2,14 +2,8 @@ import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { MatPaginator, MatSort } from '@angular/material'; import { MatPaginator, MatSort } from '@angular/material';
import { DataSource } from '@angular/cdk/collections'; import { DataSource } from '@angular/cdk/collections';
import 'rxjs/add/operator/startWith'; import { merge, Observable, BehaviorSubject, fromEvent } from 'rxjs';
import 'rxjs/add/observable/merge'; import { debounceTime, distinctUntilChanged, map } from 'rxjs/operators';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/observable/fromEvent';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';
import { FuseUtils } from '@fuse/utils'; import { FuseUtils } from '@fuse/utils';
@ -40,16 +34,18 @@ export class FuseEcommerceProductsComponent implements OnInit
ngOnInit() ngOnInit()
{ {
this.dataSource = new FilesDataSource(this.productsService, this.paginator, this.sort); this.dataSource = new FilesDataSource(this.productsService, this.paginator, this.sort);
Observable.fromEvent(this.filter.nativeElement, 'keyup')
.debounceTime(150) fromEvent(this.filter.nativeElement, 'keyup').pipe(
.distinctUntilChanged() debounceTime(150),
.subscribe(() => { distinctUntilChanged()
if ( !this.dataSource ) ).subscribe(() => {
{ if ( !this.dataSource )
return; {
} return;
this.dataSource.filter = this.filter.nativeElement.value; }
});
this.dataSource.filter = this.filter.nativeElement.value;
});
} }
} }
@ -98,19 +94,21 @@ export class FilesDataSource extends DataSource<any>
this._sort.sortChange this._sort.sortChange
]; ];
return Observable.merge(...displayDataChanges).map(() => { return merge(...displayDataChanges).pipe(map(() => {
let data = this.productsService.products.slice();
data = this.filterData(data); let data = this.productsService.products.slice();
this.filteredData = [...data]; data = this.filterData(data);
data = this.sortData(data); this.filteredData = [...data];
// Grab the page's slice of data. data = this.sortData(data);
const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
return data.splice(startIndex, this._paginator.pageSize); // Grab the page's slice of data.
}); const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
return data.splice(startIndex, this._paginator.pageSize);
}
));
} }
filterData(data) filterData(data)
@ -122,7 +120,9 @@ export class FilesDataSource extends DataSource<any>
return FuseUtils.filterArrayByString(data, this.filter); return FuseUtils.filterArrayByString(data, this.filter);
} }
sortData(data): any[] sortData(data)
:
any[]
{ {
if ( !this._sort.active || this._sort.direction === '' ) if ( !this._sort.active || this._sort.direction === '' )
{ {

View File

@ -1,8 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { BehaviorSubject, Observable } from 'rxjs';
@Injectable() @Injectable()
export class EcommerceProductsService implements Resolve<any> export class EcommerceProductsService implements Resolve<any>

View File

@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { DataSource } from '@angular/cdk/collections'; import { DataSource } from '@angular/cdk/collections';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs';
import { FileManagerService } from '../file-manager.service'; import { FileManagerService } from '../file-manager.service';
import { fuseAnimations } from '@fuse/animations/index'; import { fuseAnimations } from '@fuse/animations/index';

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable, BehaviorSubject } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable() @Injectable()
export class FileManagerService implements Resolve<any> export class FileManagerService implements Resolve<any>

View File

@ -1,6 +1,6 @@
import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core'; import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs';
import { Mail } from '../mail.model'; import { Mail } from '../mail.model';
import * as fromStore from '../store'; import * as fromStore from '../store';

View File

@ -1,6 +1,6 @@
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, HostBinding, Input, OnInit } from '@angular/core'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, HostBinding, Input, OnInit } from '@angular/core';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs';
import { MailNgrxService } from '../../mail.service'; import { MailNgrxService } from '../../mail.service';
import { Mail } from '../../mail.model'; import { Mail } from '../../mail.model';

View File

@ -1,9 +1,10 @@
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/debounceTime'; import { Observable } from 'rxjs';
import 'rxjs/add/operator/distinctUntilChanged'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { FuseTranslationLoaderService } from '@fuse/services/translation-loader.service'; import { FuseTranslationLoaderService } from '@fuse/services/translation-loader.service';
import { FuseConfigService } from '@fuse/services/config.service'; import { FuseConfigService } from '@fuse/services/config.service';
@ -76,12 +77,12 @@ export class FuseMailNgrxComponent implements OnInit, OnDestroy
this.searchInput.setValue(searchText); this.searchInput.setValue(searchText);
}); });
this.searchInput.valueChanges this.searchInput.valueChanges.pipe(
.debounceTime(300) debounceTime(300),
.distinctUntilChanged() distinctUntilChanged()
.subscribe(searchText => { ).subscribe(searchText => {
this.store.dispatch(new fromStore.SetSearchText(searchText)); this.store.dispatch(new fromStore.SetSearchText(searchText));
}); });
} }
ngOnDestroy() ngOnDestroy()

View File

@ -1,9 +1,9 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { Mail } from './mail.model';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { Observable } from 'rxjs';
import { Mail } from './mail.model';
import { MailAppState } from './store/reducers'; import { MailAppState } from './store/reducers';
import { getFiltersArr, getFoldersArr, getLabelsArr, getMailsArr } from './store/selectors'; import { getFiltersArr, getFoldersArr, getLabelsArr, getMailsArr } from './store/selectors';

View File

@ -1,9 +1,8 @@
import { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from '@angular/core'; import { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material'; import { MatDialog } from '@angular/material';
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { Observable } from 'rxjs/Observable';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { Observable } from 'rxjs';
import { MailNgrxService } from '../../mail.service'; import { MailNgrxService } from '../../mail.service';
import * as fromStore from './../../store'; import * as fromStore from './../../store';

View File

@ -1,10 +1,9 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Actions, Effect } from '@ngrx/effects'; import { Actions, Effect } from '@ngrx/effects';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/delay'; import { Observable, of } from 'rxjs';
import 'rxjs/add/operator/map';
import { of } from 'rxjs/observable/of';
import { catchError, map, switchMap } from 'rxjs/operators'; import { catchError, map, switchMap } from 'rxjs/operators';
import * as FiltersActions from '../actions/filters.actions'; import * as FiltersActions from '../actions/filters.actions';
import { MailNgrxService } from '../../mail.service'; import { MailNgrxService } from '../../mail.service';

View File

@ -1,10 +1,9 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Actions, Effect } from '@ngrx/effects'; import { Actions, Effect } from '@ngrx/effects';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/delay'; import { Observable, of } from 'rxjs';
import 'rxjs/add/operator/map';
import { of } from 'rxjs/observable/of';
import { catchError, map, switchMap } from 'rxjs/operators'; import { catchError, map, switchMap } from 'rxjs/operators';
import * as FoldersActions from '../actions/folders.actions'; import * as FoldersActions from '../actions/folders.actions';
import { MailNgrxService } from '../../mail.service'; import { MailNgrxService } from '../../mail.service';

View File

@ -1,10 +1,9 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Actions, Effect } from '@ngrx/effects'; import { Actions, Effect } from '@ngrx/effects';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/delay'; import { Observable, of } from 'rxjs';
import 'rxjs/add/operator/map';
import { of } from 'rxjs/observable/of';
import { catchError, map, switchMap } from 'rxjs/operators'; import { catchError, map, switchMap } from 'rxjs/operators';
import * as LabelsActions from '../actions/labels.actions'; import * as LabelsActions from '../actions/labels.actions';
import { MailNgrxService } from '../../mail.service'; import { MailNgrxService } from '../../mail.service';

View File

@ -1,9 +1,9 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Action, Store } from '@ngrx/store'; import { Action, Store } from '@ngrx/store';
import { Actions, Effect } from '@ngrx/effects'; import { Actions, Effect } from '@ngrx/effects';
import { Observable, of } from 'rxjs';
import { catchError, map, mergeMap, exhaustMap, withLatestFrom } from 'rxjs/operators'; import { Observable, of, forkJoin } from 'rxjs';
import 'rxjs/add/operator/debounceTime'; import { catchError, debounceTime, map, mergeMap, exhaustMap, withLatestFrom } from 'rxjs/operators';
import { getRouterState, State } from 'app/store/reducers'; import { getRouterState, State } from 'app/store/reducers';
import { getMailsState } from '../selectors'; import { getMailsState } from '../selectors';
@ -83,10 +83,11 @@ export class MailsEffect
.ofType<MailsActions.UpdateMail>(MailsActions.UPDATE_MAIL) .ofType<MailsActions.UpdateMail>(MailsActions.UPDATE_MAIL)
.pipe( .pipe(
exhaustMap((action) => { exhaustMap((action) => {
return this.mailService.updateMail(action.payload) return this.mailService.updateMail(action.payload).pipe(
.map(() => { map(() => {
return new MailsActions.UpdateMailSuccess(action.payload); return new MailsActions.UpdateMailSuccess(action.payload);
}); })
);
}) })
); );
@ -100,7 +101,7 @@ export class MailsEffect
.ofType<MailsActions.UpdateMails>(MailsActions.UPDATE_MAILS) .ofType<MailsActions.UpdateMails>(MailsActions.UPDATE_MAILS)
.pipe( .pipe(
exhaustMap((action) => { exhaustMap((action) => {
return Observable.forkJoin( return forkJoin(
action.payload.map(mail => this.mailService.updateMail(mail)), action.payload.map(mail => this.mailService.updateMail(mail)),
() => { () => {
return new MailsActions.UpdateMailsSuccess(); return new MailsActions.UpdateMailsSuccess();
@ -182,8 +183,8 @@ export class MailsEffect
updateMailSuccess: Observable<MailsActions.MailsActionsAll> = updateMailSuccess: Observable<MailsActions.MailsActionsAll> =
this.actions this.actions
.ofType<MailsActions.UpdateMailSuccess>(MailsActions.UPDATE_MAIL_SUCCESS) .ofType<MailsActions.UpdateMailSuccess>(MailsActions.UPDATE_MAIL_SUCCESS)
.debounceTime(500)
.pipe( .pipe(
debounceTime(500),
map(() => { map(() => {
return new MailsActions.GetMails(); return new MailsActions.GetMails();
}) })

View File

@ -1,10 +1,10 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, CanActivate } from '@angular/router'; import { ActivatedRouteSnapshot, CanActivate } from '@angular/router';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of'; import { Observable, forkJoin, of } from 'rxjs';
import { map, switchMap, catchError, tap, take, filter } from 'rxjs/operators'; import { map, switchMap, catchError, tap, take, filter } from 'rxjs/operators';
import 'rxjs/add/observable/forkJoin';
import { MailAppState } from '../reducers'; import { MailAppState } from '../reducers';
import * as fromStore from '../index'; import * as fromStore from '../index';
import { getFiltersLoaded, getFoldersLoaded, getLabelsLoaded, getMailsLoaded } from '../selectors'; import { getFiltersLoaded, getFoldersLoaded, getLabelsLoaded, getMailsLoaded } from '../selectors';
@ -38,8 +38,7 @@ export class ResolveGuard implements CanActivate
checkStore(): Observable<any> checkStore(): Observable<any>
{ {
return Observable return forkJoin(
.forkJoin(
this.getFolders(), this.getFolders(),
this.getFilters(), this.getFilters(),
this.getLabels() this.getLabels()

View File

@ -1,5 +1,5 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';

View File

@ -1,5 +1,5 @@
import { Component, HostBinding, Input, OnDestroy, OnInit } from '@angular/core'; import { Component, HostBinding, Input, OnDestroy, OnInit } from '@angular/core';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { Mail } from '../../mail.model'; import { Mail } from '../../mail.model';
import { MailService } from '../../mail.service'; import { MailService } from '../../mail.service';

View File

@ -1,7 +1,7 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';

View File

@ -1,8 +1,8 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Subscription } from 'rxjs/Subscription';
import 'rxjs/add/operator/debounceTime'; import { Subscription } from 'rxjs';
import 'rxjs/add/operator/distinctUntilChanged'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { FuseTranslationLoaderService } from '@fuse/services/translation-loader.service'; import { FuseTranslationLoaderService } from '@fuse/services/translation-loader.service';
@ -84,9 +84,10 @@ export class FuseMailComponent implements OnInit, OnDestroy
} }
}); });
this.searchInput.valueChanges this.searchInput.valueChanges.pipe(
.debounceTime(300) debounceTime(300),
.distinctUntilChanged() distinctUntilChanged()
)
.subscribe(searchText => { .subscribe(searchText => {
this.mailService.onSearchTextChanged.next(searchText); this.mailService.onSearchTextChanged.next(searchText);
}); });

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { FuseUtils } from '@fuse/utils'; import { FuseUtils } from '@fuse/utils';

View File

@ -1,7 +1,7 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material'; import { MatDialog } from '@angular/material';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';

View File

@ -1,7 +1,8 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';

View File

@ -1,7 +1,8 @@
import { Component, Inject, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; import { Component, Inject, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { NgForm } from '@angular/forms/src/forms'; import { NgForm } from '@angular/forms/src/forms';
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatMenuTrigger } from '@angular/material'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatMenuTrigger } from '@angular/material';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { FuseConfirmDialogComponent } from '@fuse/components/confirm-dialog/confirm-dialog.component'; import { FuseConfirmDialogComponent } from '@fuse/components/confirm-dialog/confirm-dialog.component';
import { FuseUtils } from '@fuse/utils'; import { FuseUtils } from '@fuse/utils';

View File

@ -1,5 +1,6 @@
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewEncapsulation } from '@angular/core'; import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewEncapsulation } from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';
import { FuseUtils } from '@fuse/utils'; import { FuseUtils } from '@fuse/utils';

View File

@ -1,7 +1,8 @@
import { Component, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; import { Component, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { MatDialog, MatDialogRef } from '@angular/material'; import { MatDialog, MatDialogRef } from '@angular/material';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { FuseConfirmDialogComponent } from '@fuse/components/confirm-dialog/confirm-dialog.component'; import { FuseConfirmDialogComponent } from '@fuse/components/confirm-dialog/confirm-dialog.component';
import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive'; import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';

View File

@ -1,5 +1,6 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { MatColors } from '@fuse/mat-colors'; import { MatColors } from '@fuse/mat-colors';

View File

@ -1,5 +1,6 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';

View File

@ -1,6 +1,7 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';

View File

@ -2,8 +2,7 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable'; import { Observable, BehaviorSubject } from 'rxjs';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable() @Injectable()
export class ScrumboardService implements Resolve<any> export class ScrumboardService implements Resolve<any>

View File

@ -1,6 +1,6 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';

View File

@ -1,8 +1,8 @@
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms'; import { FormBuilder, FormGroup } from '@angular/forms';
import { Subscription } from 'rxjs/Subscription';
import 'rxjs/add/operator/debounceTime'; import { Subscription } from 'rxjs';
import 'rxjs/add/operator/distinctUntilChanged'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { FuseUtils } from '@fuse/utils'; import { FuseUtils } from '@fuse/utils';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';
@ -53,12 +53,12 @@ export class FuseTodoDetailsComponent implements OnInit, OnDestroy
this.todoForm = this.createTodoForm(); this.todoForm = this.createTodoForm();
this.onFormChange = this.onFormChange =
this.todoForm.valueChanges this.todoForm.valueChanges.pipe(
.debounceTime(500) debounceTime(500),
.distinctUntilChanged() distinctUntilChanged()
.subscribe(data => { ).subscribe(data => {
this.todoService.updateTodo(data); this.todoService.updateTodo(data);
}); });
} }
}); });

View File

@ -1,6 +1,6 @@
import { Component, HostBinding, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; import { Component, HostBinding, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { Todo } from '../../todo.model'; import { Todo } from '../../todo.model';
import { TodoService } from '../../todo.service'; import { TodoService } from '../../todo.service';

View File

@ -1,7 +1,7 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';

View File

@ -1,8 +1,8 @@
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Subscription } from 'rxjs/Subscription';
import 'rxjs/add/operator/debounceTime'; import { Subscription } from 'rxjs';
import 'rxjs/add/operator/distinctUntilChanged'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';
@ -58,12 +58,12 @@ export class FuseTodoComponent implements OnInit, OnDestroy
this.tags = this.todoService.tags; this.tags = this.todoService.tags;
}); });
this.searchInput.valueChanges this.searchInput.valueChanges.pipe(
.debounceTime(300) debounceTime(300),
.distinctUntilChanged() distinctUntilChanged()
.subscribe(searchText => { ).subscribe(searchText => {
this.todoService.onSearchTextChanged.next(searchText); this.todoService.onSearchTextChanged.next(searchText);
}); });
this.onCurrentTodoChanged = this.onCurrentTodoChanged =
this.todoService.onCurrentTodoChanged this.todoService.onCurrentTodoChanged

View File

@ -2,9 +2,7 @@ import { Injectable } from '@angular/core';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable'; import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Subject } from 'rxjs/Subject';
import { FuseUtils } from '@fuse/utils'; import { FuseUtils } from '@fuse/utils';

View File

@ -1,6 +1,6 @@
import { AfterViewInit, Component, ComponentFactoryResolver, ComponentRef, Input, OnDestroy, ViewChild, ViewContainerRef, ViewEncapsulation } from '@angular/core'; import { AfterViewInit, Component, ComponentFactoryResolver, ComponentRef, Input, OnDestroy, ViewChild, ViewContainerRef, ViewEncapsulation } from '@angular/core';
import { MatSnackBar } from '@angular/material'; import { MatSnackBar } from '@angular/material';
import 'rxjs/add/operator/first';
import 'prismjs/components/prism-scss'; import 'prismjs/components/prism-scss';
import 'prismjs/components/prism-typescript'; import 'prismjs/components/prism-typescript';

View File

@ -1,9 +1,8 @@
import { Component, HostBinding, OnDestroy } from '@angular/core'; import { Component, HostBinding, OnDestroy } from '@angular/core';
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import 'rxjs/add/operator/filter'; import { filter, map } from 'rxjs/operators';
import 'rxjs/add/operator/map';
import { fuseAnimations } from '@fuse/animations/index'; import { fuseAnimations } from '@fuse/animations/index';
import { FuseConfigService } from '@fuse/services/config.service'; import { FuseConfigService } from '@fuse/services/config.service';
@ -31,29 +30,29 @@ export class FuseContentComponent implements OnDestroy
private fuseConfig: FuseConfigService private fuseConfig: FuseConfigService
) )
{ {
this.router.events this.router.events.pipe(
.filter((event) => event instanceof NavigationEnd) filter((event) => event instanceof NavigationEnd),
.map(() => this.activatedRoute) map(() => this.activatedRoute)
.subscribe((event) => { ).subscribe((event) => {
switch ( this.fuseSettings.routerAnimation ) switch ( this.fuseSettings.routerAnimation )
{ {
case 'fadeIn': case 'fadeIn':
this.routeAnimationFade = !this.routeAnimationFade; this.routeAnimationFade = !this.routeAnimationFade;
break; break;
case 'slideUp': case 'slideUp':
this.routeAnimationUp = !this.routeAnimationUp; this.routeAnimationUp = !this.routeAnimationUp;
break; break;
case 'slideDown': case 'slideDown':
this.routeAnimationDown = !this.routeAnimationDown; this.routeAnimationDown = !this.routeAnimationDown;
break; break;
case 'slideRight': case 'slideRight':
this.routeAnimationRight = !this.routeAnimationRight; this.routeAnimationRight = !this.routeAnimationRight;
break; break;
case 'slideLeft': case 'slideLeft':
this.routeAnimationLeft = !this.routeAnimationLeft; this.routeAnimationLeft = !this.routeAnimationLeft;
break; break;
} }
}); });
this.onConfigChanged = this.onConfigChanged =
this.fuseConfig.onConfigChanged this.fuseConfig.onConfigChanged

View File

@ -1,8 +1,8 @@
import { Component, OnInit, OnDestroy } from '@angular/core'; import { Component, OnInit, OnDestroy } from '@angular/core';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Subscription } from 'rxjs/Subscription';
import 'rxjs/add/operator/debounceTime'; import { Subscription } from 'rxjs';
import 'rxjs/add/operator/distinctUntilChanged'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { FuseUtils } from '@fuse/utils'; import { FuseUtils } from '@fuse/utils';
@ -35,12 +35,12 @@ export class FuseFaqComponent implements OnInit, OnDestroy
this.faqsFiltered = response; this.faqsFiltered = response;
}); });
this.searchInput.valueChanges this.searchInput.valueChanges.pipe(
.debounceTime(300) debounceTime(300),
.distinctUntilChanged() distinctUntilChanged()
.subscribe(searchText => { ).subscribe(searchText => {
this.faqsFiltered = FuseUtils.filterArrayByString(this.faqs, searchText); this.faqsFiltered = FuseUtils.filterArrayByString(this.faqs, searchText);
}); });
} }
ngOnDestroy() ngOnDestroy()

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable() @Injectable()
export class FaqService implements Resolve<any> export class FaqService implements Resolve<any>

View File

@ -1,9 +1,8 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable() @Injectable()
export class InvoiceService implements Resolve<any> export class InvoiceService implements Resolve<any>

View File

@ -1,6 +1,6 @@
import { Component, OnInit, OnDestroy, ViewEncapsulation} from '@angular/core'; import { Component, OnInit, OnDestroy, ViewEncapsulation} from '@angular/core';
import { MatDialog } from '@angular/material'; import { MatDialog } from '@angular/material';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { KnowledgeBaseService } from './knowledge-base.service'; import { KnowledgeBaseService } from './knowledge-base.service';
import { FuseKnowledgeBaseArticleComponent } from './dialogs/article/article.component'; import { FuseKnowledgeBaseArticleComponent } from './dialogs/article/article.component';

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable() @Injectable()
export class KnowledgeBaseService implements Resolve<any> export class KnowledgeBaseService implements Resolve<any>

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable() @Injectable()
export class ProfileService implements Resolve<any> export class ProfileService implements Resolve<any>

View File

@ -1,9 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable() @Injectable()
export class SearchService implements Resolve<any> export class SearchService implements Resolve<any>

View File

@ -1,7 +1,7 @@
import { Component, ElementRef, HostBinding, Inject, OnDestroy, Renderer2, ViewEncapsulation } from '@angular/core'; import { Component, ElementRef, HostBinding, Inject, OnDestroy, Renderer2, ViewEncapsulation } from '@angular/core';
import { DOCUMENT } from '@angular/common'; import { DOCUMENT } from '@angular/common';
import { Platform } from '@angular/cdk/platform'; import { Platform } from '@angular/cdk/platform';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs';
import { FuseConfigService } from '@fuse/services/config.service'; import { FuseConfigService } from '@fuse/services/config.service';

View File

@ -1,6 +1,7 @@
import { Component, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; import { Component, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router'; import { NavigationEnd, Router } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive'; import { FusePerfectScrollbarDirective } from '@fuse/directives/fuse-perfect-scrollbar/fuse-perfect-scrollbar.directive';
import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service'; import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';