mainstack-payments 0.0.4 → 0.0.5

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.
@@ -16546,31 +16546,32 @@ var YI = function() {
16546
16546
  };
16547
16547
  const db = ({
16548
16548
  queryFn: e,
16549
- enabled: t = !0
16549
+ enabled: t = !0,
16550
+ dependingOn: n = []
16550
16551
  }) => {
16551
- const [n, r] = de(), [a, o] = de(!1), [i, s] = de(), l = async () => {
16552
- const c = {
16552
+ const [r, a] = de(), [o, i] = de(!1), [s, l] = de(), c = async () => {
16553
+ const u = {
16553
16554
  data: {},
16554
16555
  isSuccess: !0,
16555
16556
  error: {}
16556
16557
  };
16557
16558
  try {
16558
- o(!0);
16559
- const u = await e();
16560
- r(u), c.data = u;
16561
- } catch (u) {
16562
- throw s(u), c.error = i, c.isSuccess = !1, new Error(u);
16559
+ i(!0);
16560
+ const d = await e();
16561
+ a(d), u.data = d;
16562
+ } catch (d) {
16563
+ throw l(d), u.error = s, u.isSuccess = !1, new Error(d);
16563
16564
  } finally {
16564
- o(!1);
16565
+ i(!1);
16565
16566
  }
16566
- return c;
16567
+ return u;
16567
16568
  };
16568
16569
  return ve(() => {
16569
- t && l();
16570
- }, []), {
16571
- data: n,
16572
- isLoading: a,
16573
- refetch: l
16570
+ t && c();
16571
+ }, [...n]), {
16572
+ data: r,
16573
+ isLoading: o,
16574
+ refetch: c
16574
16575
  };
16575
16576
  }, fb = ({
16576
16577
  mutationFn: e
@@ -16605,7 +16606,8 @@ const db = ({
16605
16606
  ).then((o) => o.data).catch((o) => {
16606
16607
  throw o.response.data;
16607
16608
  }),
16608
- enabled: !!n && n > 0
16609
+ enabled: !!n && n > 0,
16610
+ dependingOn: [n, t, e, r]
16609
16611
  }), XI = (e) => fb({
16610
16612
  mutationFn: async (t) => {
16611
16613
  var n;
@@ -1,6 +1,7 @@
1
- export declare const useQuery: ({ queryFn, enabled, }: {
1
+ export declare const useQuery: ({ queryFn, enabled, dependingOn, }: {
2
2
  queryFn: () => Promise<any>;
3
3
  enabled?: boolean | undefined;
4
+ dependingOn?: any[] | undefined;
4
5
  }) => {
5
6
  data: any;
6
7
  isLoading: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mainstack-payments",
3
3
  "type": "module",
4
- "version": "0.0.4",
4
+ "version": "0.0.5",
5
5
  "main": "build/mainstack-payments.js",
6
6
  "types": "build/src/index.d.ts",
7
7
  "files": [