@faasjs/react 0.0.3-beta.72 → 0.0.3-beta.74

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.
package/dist/index.d.ts CHANGED
@@ -14,7 +14,6 @@ type FaasData<T = any> = T extends FaasActionPaths ? FaasActions[T]['Data'] : T;
14
14
  interface FaasDataInjection<Data = any> {
15
15
  action: string | any;
16
16
  params: Record<string, any>;
17
- setParams: React.Dispatch<React.SetStateAction<any>>;
18
17
  loading: boolean;
19
18
  data: Data;
20
19
  error: any;
@@ -31,7 +30,6 @@ interface FaasDataWrapperProps<PathOrData extends FaasAction> {
31
30
  fallback?: JSX.Element | false;
32
31
  action: string;
33
32
  params?: FaasParams<PathOrData>;
34
- setParams?: React.Dispatch<React.SetStateAction<FaasParams<PathOrData>>>;
35
33
  onDataChange?(args: FaasDataInjection<FaasData<PathOrData>>): void;
36
34
  /** use custom data, should work with setData */
37
35
  data?: FaasData<PathOrData>;
package/dist/index.js CHANGED
@@ -59,7 +59,7 @@ function FaasReactClient({
59
59
  }
60
60
  }, [JSON.stringify(defaultParams)]);
61
61
  (0, import_react.useEffect)(function() {
62
- if (options2 == null ? void 0 : options2.skip) {
62
+ if (!action || (options2 == null ? void 0 : options2.skip)) {
63
63
  setLoading(false);
64
64
  return;
65
65
  }
@@ -93,15 +93,13 @@ function FaasReactClient({
93
93
  return {
94
94
  action,
95
95
  params,
96
- setParams,
97
96
  loading,
98
97
  data: (options2 == null ? void 0 : options2.data) || data,
99
98
  error,
100
99
  promise,
101
100
  async reload(params2) {
102
- if (params2) {
103
- options2.setParams ? options2.setParams(params2) : setParams(params2);
104
- }
101
+ if (params2)
102
+ setParams(params2);
105
103
  setReloadTimes(reloadTimes + 1);
106
104
  return promise;
107
105
  },
package/dist/index.mjs CHANGED
@@ -38,7 +38,7 @@ function FaasReactClient({
38
38
  }
39
39
  }, [JSON.stringify(defaultParams)]);
40
40
  useEffect(function() {
41
- if (options2 == null ? void 0 : options2.skip) {
41
+ if (!action || (options2 == null ? void 0 : options2.skip)) {
42
42
  setLoading(false);
43
43
  return;
44
44
  }
@@ -72,15 +72,13 @@ function FaasReactClient({
72
72
  return {
73
73
  action,
74
74
  params,
75
- setParams,
76
75
  loading,
77
76
  data: (options2 == null ? void 0 : options2.data) || data,
78
77
  error,
79
78
  promise,
80
79
  async reload(params2) {
81
- if (params2) {
82
- options2.setParams ? options2.setParams(params2) : setParams(params2);
83
- }
80
+ if (params2)
81
+ setParams(params2);
84
82
  setReloadTimes(reloadTimes + 1);
85
83
  return promise;
86
84
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/react",
3
- "version": "0.0.3-beta.72",
3
+ "version": "0.0.3-beta.74",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -22,7 +22,7 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@faasjs/browser": "^0.0.3-beta.72"
25
+ "@faasjs/browser": "^0.0.3-beta.74"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "*"