@readyfor/api-client-base 1.56.0-pr1408.9c29605 → 1.56.0-pr1409.657b73e

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.
@@ -8,9 +8,11 @@ let react_jsx_runtime = require("react/jsx-runtime");
8
8
  const ApiClientConfigContext = (0, react.createContext)(require_apiClientConfigStore.store);
9
9
  const ApiClientConfigProvider = (props) => {
10
10
  const { swr: swr$1, ...config } = props.config;
11
- (0, react.useEffect)(() => {
11
+ const prevConfigRef = (0, react.useRef)(null);
12
+ if (prevConfigRef.current !== config) {
12
13
  require_apiClientConfigStore.store.setState(() => config);
13
- }, [config]);
14
+ prevConfigRef.current = config;
15
+ }
14
16
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ApiClientConfigContext.Provider, {
15
17
  value: require_apiClientConfigStore.store,
16
18
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(swr.SWRConfig, {
@@ -1,5 +1,5 @@
1
1
  import { i as mergeRequestInit, r as store } from "../apiClientConfigStore-DDleIkQN.mjs";
2
- import { createContext, useContext, useEffect, useMemo, useRef } from "react";
2
+ import { createContext, useContext, useMemo, useRef } from "react";
3
3
  import { SWRConfig } from "swr";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { useSyncExternalStore } from "use-sync-external-store/shim/index.js";
@@ -32,9 +32,11 @@ const createSwrConfig = (config) => ({
32
32
  const ApiClientConfigContext = createContext(store);
33
33
  const ApiClientConfigProvider = (props) => {
34
34
  const { swr, ...config } = props.config;
35
- useEffect(() => {
35
+ const prevConfigRef = useRef(null);
36
+ if (prevConfigRef.current !== config) {
36
37
  store.setState(() => config);
37
- }, [config]);
38
+ prevConfigRef.current = config;
39
+ }
38
40
  return /* @__PURE__ */ jsx(ApiClientConfigContext.Provider, {
39
41
  value: store,
40
42
  children: /* @__PURE__ */ jsx(SWRConfig, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readyfor/api-client-base",
3
- "version": "1.56.0-pr1408.9c29605",
3
+ "version": "1.56.0-pr1409.657b73e",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -34,8 +34,10 @@
34
34
  "devDependencies": {
35
35
  "@types/qs": "6.15.1",
36
36
  "@types/react": "19.2.17",
37
+ "@types/react-dom": "19.2.3",
37
38
  "@types/use-sync-external-store": "1.5.0",
38
- "react": "19.2.7",
39
+ "react": "19.2.8",
40
+ "react-dom": "19.2.8",
39
41
  "swr": "2.4.2",
40
42
  "use-sync-external-store": "1.6.0"
41
43
  },