wagmi 2.12.14 → 2.12.16

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.
@@ -1,2 +1,2 @@
1
- export const version = '2.12.14';
1
+ export const version = '2.12.16';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSyncExternalStoreWithTracked.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSyncExternalStoreWithTracked.ts"],"names":[],"mappings":"AASA,wBAAgB,+BAA+B,CAC7C,QAAQ,SAAS,SAAS,EAC1B,SAAS,GAAG,QAAQ,EAEpB,SAAS,EAAE,CAAC,aAAa,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,EACpD,WAAW,EAAE,MAAM,QAAQ,EAC3B,iBAAiB,GAAE,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAe,EACpE,OAAO,GAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,KAAK,OAAmB,YAgD7D"}
1
+ {"version":3,"file":"useSyncExternalStoreWithTracked.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSyncExternalStoreWithTracked.ts"],"names":[],"mappings":"AASA,wBAAgB,+BAA+B,CAC7C,QAAQ,SAAS,SAAS,EAC1B,SAAS,GAAG,QAAQ,EAEpB,SAAS,EAAE,CAAC,aAAa,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,EACpD,WAAW,EAAE,MAAM,QAAQ,EAC3B,iBAAiB,GAAE,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAe,EACpE,OAAO,GAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,KAAK,OAAmB,YAkD7D"}
@@ -1,2 +1,2 @@
1
- export declare const version = "2.12.14";
1
+ export declare const version = "2.12.16";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wagmi",
3
3
  "description": "React Hooks for Ethereum",
4
- "version": "2.12.14",
4
+ "version": "2.12.16",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -96,8 +96,8 @@
96
96
  },
97
97
  "dependencies": {
98
98
  "use-sync-external-store": "1.2.0",
99
- "@wagmi/connectors": "5.1.13",
100
- "@wagmi/core": "2.13.7"
99
+ "@wagmi/connectors": "5.1.14",
100
+ "@wagmi/core": "2.13.8"
101
101
  },
102
102
  "contributors": [
103
103
  "awkweb.eth <t@wevm.dev>",
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
 
3
3
  import { deepEqual } from '@wagmi/core/internal'
4
- import { useRef } from 'react'
4
+ import { useMemo, useRef } from 'react'
5
5
  import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector.js'
6
6
 
7
7
  const isPlainObject = (obj: unknown) =>
@@ -37,29 +37,31 @@ export function useSyncExternalStoreWithTracked<
37
37
  },
38
38
  )
39
39
 
40
- if (isPlainObject(result)) {
41
- const trackedResult = { ...result }
42
- let properties = {}
43
- for (const [key, value] of Object.entries(
44
- trackedResult as { [key: string]: any },
45
- )) {
46
- properties = {
47
- ...properties,
48
- [key]: {
49
- configurable: false,
50
- enumerable: true,
51
- get: () => {
52
- if (!trackedKeys.current.includes(key)) {
53
- trackedKeys.current.push(key)
54
- }
55
- return value
40
+ return useMemo(() => {
41
+ if (isPlainObject(result)) {
42
+ const trackedResult = { ...result }
43
+ let properties = {}
44
+ for (const [key, value] of Object.entries(
45
+ trackedResult as { [key: string]: any },
46
+ )) {
47
+ properties = {
48
+ ...properties,
49
+ [key]: {
50
+ configurable: false,
51
+ enumerable: true,
52
+ get: () => {
53
+ if (!trackedKeys.current.includes(key)) {
54
+ trackedKeys.current.push(key)
55
+ }
56
+ return value
57
+ },
56
58
  },
57
- },
59
+ }
58
60
  }
61
+ Object.defineProperties(trackedResult, properties)
62
+ return trackedResult
59
63
  }
60
- Object.defineProperties(trackedResult, properties)
61
- return trackedResult
62
- }
63
64
 
64
- return result
65
+ return result
66
+ }, [result])
65
67
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.12.14'
1
+ export const version = '2.12.16'