more tests for request service

This commit is contained in:
Art Lowel
2018-01-19 10:40:04 +01:00
parent 55bb142d3a
commit b771503cf7
5 changed files with 343 additions and 161 deletions

View File

@@ -15,16 +15,16 @@ export class RemoteData<T> {
constructor(
private requestPending: boolean,
private responsePending: boolean,
private isSuccessFul: boolean,
private isSuccessful: boolean,
public error: RemoteDataError,
public payload: T
) {
}
get state(): RemoteDataState {
if (this.isSuccessFul === true && hasValue(this.payload)) {
if (this.isSuccessful === true && hasValue(this.payload)) {
return RemoteDataState.Success
} else if (this.isSuccessFul === false) {
} else if (this.isSuccessful === false) {
return RemoteDataState.Failed
} else if (this.requestPending === true) {
return RemoteDataState.RequestPending