cleaned up remotedata for a better separation of concerns, moved statuscode and errormsg in to RemoteDataError object, moved pageInfo to PaginatedList object in the payload

This commit is contained in:
Art Lowel
2017-12-07 11:28:44 +01:00
parent 98a49b3191
commit d775467fcb
17 changed files with 162 additions and 128 deletions

View File

@@ -1,5 +1,5 @@
import { PageInfo } from '../shared/page-info.model';
import { hasValue } from '../../shared/empty.util';
import { RemoteDataError } from './remote-data-error';
export enum RemoteDataState {
RequestPending = 'RequestPending',
@@ -13,13 +13,10 @@ export enum RemoteDataState {
*/
export class RemoteData<T> {
constructor(
public self: string,
private requestPending: boolean,
private responsePending: boolean,
private isSuccessFul: boolean,
public errorMessage: string,
public statusCode: string,
public pageInfo: PageInfo,
public error: RemoteDataError,
public payload: T
) {
}