fixed lint errors

This commit is contained in:
William Welling
2017-07-13 11:19:02 -05:00
parent 75cb60e70f
commit 066bba28af
123 changed files with 1295 additions and 1407 deletions

View File

@@ -1,11 +1,12 @@
import { Observable } from "rxjs";
import { PageInfo } from "../shared/page-info.model";
import { Observable } from 'rxjs/Observable';
import { PageInfo } from '../shared/page-info.model';
export enum RemoteDataState {
RequestPending = <any>"RequestPending",
ResponsePending = <any>"ResponsePending",
Failed = <any>"Failed",
Success = <any>"Success"
RequestPending = 'RequestPending' as any,
ResponsePending = 'ResponsePending' as any,
Failed = 'Failed' as any,
Success = 'Success' as any
}
/**
@@ -32,14 +33,11 @@ export class RemoteData<T> {
(requestPending, responsePending, isSuccessFul) => {
if (requestPending) {
return RemoteDataState.RequestPending
}
else if (responsePending) {
} else if (responsePending) {
return RemoteDataState.ResponsePending
}
else if (!isSuccessFul) {
} else if (!isSuccessFul) {
return RemoteDataState.Failed
}
else {
} else {
return RemoteDataState.Success
}
}
@@ -47,36 +45,26 @@ export class RemoteData<T> {
}
get isRequestPending(): Observable<boolean> {
return this.state
.map(state => state == RemoteDataState.RequestPending)
.distinctUntilChanged();
return this.state.map((state) => state === RemoteDataState.RequestPending).distinctUntilChanged();
}
get isResponsePending(): Observable<boolean> {
return this.state
.map(state => state == RemoteDataState.ResponsePending)
.distinctUntilChanged();
return this.state.map((state) => state === RemoteDataState.ResponsePending).distinctUntilChanged();
}
get isLoading(): Observable<boolean> {
return this.state
.map(state => {
return state == RemoteDataState.RequestPending
|| state === RemoteDataState.ResponsePending
})
.distinctUntilChanged();
return this.state.map((state) => {
return state === RemoteDataState.RequestPending
|| state === RemoteDataState.ResponsePending
}).distinctUntilChanged();
}
get hasFailed(): Observable<boolean> {
return this.state
.map(state => state == RemoteDataState.Failed)
.distinctUntilChanged();
return this.state.map((state) => state === RemoteDataState.Failed).distinctUntilChanged();
}
get hasSucceeded(): Observable<boolean> {
return this.state
.map(state => state == RemoteDataState.Success)
.distinctUntilChanged();
return this.state.map((state) => state === RemoteDataState.Success).distinctUntilChanged();
}
}