revdev-components 0.36.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,16 +4,18 @@ export declare enum ApiStatus {
4
4
  Success = 2,
5
5
  NotFound = 3
6
6
  }
7
- export type ApiResponse<TResponse, TRequest> = {
7
+ export type ApiResponse<TResponse, TRequest, TError = any> = {
8
8
  data?: TResponse;
9
9
  isLoading: boolean;
10
10
  isSuccess: boolean;
11
+ isError: boolean;
11
12
  originalArgs?: TRequest;
13
+ error: TError;
12
14
  };
13
15
  export type ApiRequestMethod<TRequest> = (request: TRequest) => void;
14
16
  export interface ApiMutationResponse<TResponse, TRequest> {
15
17
  request: ApiRequestMethod<TRequest>;
16
- response?: TResponse;
18
+ data?: TResponse;
17
19
  status: ApiStatus;
18
20
  originalArgs?: TRequest;
19
21
  }
package/build/index.js CHANGED
@@ -4766,7 +4766,7 @@ function useApiResponse(requestMethod, responseObject, status) {
4766
4766
  return React.useMemo(function () {
4767
4767
  return {
4768
4768
  request: requestMethod,
4769
- response: responseObject.data,
4769
+ data: responseObject.data,
4770
4770
  originalArgs: responseObject.originalArgs,
4771
4771
  status: status,
4772
4772
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev-components",
3
- "version": "0.36.0",
3
+ "version": "0.38.0",
4
4
  "main": "build/index.js",
5
5
  "module": "build/index.esm.js",
6
6
  "scripts": {