Moved from tslint to eslint as tslint was depreciated.

Added prettier and also prettied all the typescript files using prettier

ESLint is using the AirBnB rules which are the most strict to lint the files.
This commit is contained in:
tanshu committed 2020-10-01 21:28:12 +05:30
1 parent 40e79ff949
commit 1350870f9e
545 files changed
+8455 -7036

No files matched your search

@@ -1,33 +1,29 @@
import {DataSource} from '@angular/cdk/collections';
import { DataSource } from '@angular/cdk/collections';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import {map} from 'rxjs/operators';
import {merge, Observable, of as observableOf} from 'rxjs';
import {Client} from '../client';
import { map } from 'rxjs/operators';
import { merge, Observable, of as observableOf } from 'rxjs';
import { Client } from '../client';
export class ClientListDataSource extends DataSource<Client> {
constructor(private paginator: MatPaginator, private sort: MatSort, public data: Client[]) {
super();
}
connect(): Observable<Client[]> {
const dataMutations = [
observableOf(this.data),
this.paginator.page,
this.sort.sortChange
];
const dataMutations = [observableOf(this.data), this.paginator.page, this.sort.sortChange];
// Set the paginators length
this.paginator.length = this.data.length;
return merge(...dataMutations).pipe(map(() => {
return this.getPagedData(this.getSortedData([...this.data]));
}));
return merge(...dataMutations).pipe(
map(() => {
return this.getPagedData(this.getSortedData([...this.data]));
}),
);
}
disconnect() {
}
disconnect() {}
private getPagedData(data: Client[]) {
const startIndex = this.paginator.pageIndex * this.paginator.pageSize;