All files / src/domain/ApiResponse index.js

100% Statements 5/5
100% Branches 0/0
100% Functions 5/5
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31                  4x       4x       2x       2x       1x          
import { Record } from 'immutable';
import { ApiResponseHelper } from 'domain/ApiResponseHelper';
 
export class ApiResponse extends Record({
  data: undefined,
  error: undefined,
  loading: false,
}) {
  shouldFetch() {
    return ApiResponseHelper.shouldFetch(this);
  }
 
  fetchWasCalled() {
    return ApiResponseHelper.fetchWasCalled(this);
  }
 
  isLoading() {
    return ApiResponseHelper.isLoading(this);
  }
 
  hasFailed() {
    return ApiResponseHelper.hasFailed(this);
  }
 
  hasSucceeded() {
    return ApiResponseHelper.hasSucceeded(this);
  }
}
 
export default ApiResponse;