@graphcommerce/next-ui 6.0.0-canary.51 → 6.0.0-canary.52

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 6.0.0-canary.52
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1809](https://github.com/graphcommerce-org/graphcommerce/pull/1809) [`2da3c9214`](https://github.com/graphcommerce-org/graphcommerce/commit/2da3c92148aef08813b95e404a25796acf0eefd2) - Added useMemoObject and implement in GaViewItem, GoogleAnalyticsItemList and GaCartStartCheckoutLinkOrButton ([@mikekeehnen](https://github.com/mikekeehnen))
8
+
3
9
  ## 6.0.0-canary.51
4
10
 
5
11
  ## 6.0.0-canary.50
package/hooks/index.ts CHANGED
@@ -2,5 +2,6 @@ export * from './useDateTimeFormat'
2
2
  export * from './useMatchMedia'
3
3
  export * from './useMemoDeep'
4
4
  export * from './useNumberFormat'
5
+ export * from './useMemoObject'
5
6
  export * from './useStorefrontConfig'
6
7
  export * from './useUrlQuery'
@@ -0,0 +1,12 @@
1
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
+ import { equal } from '@wry/equality'
3
+ import { useRef } from 'react'
4
+
5
+ /** Always returns the same object if it structurally the same. */
6
+ export function useMemoObject<T>(obj: T): T {
7
+ const ref = useRef<T>(obj)
8
+ if (!equal(obj, ref.current)) {
9
+ ref.current = obj
10
+ }
11
+ return ref.current
12
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/next-ui",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "6.0.0-canary.51",
5
+ "version": "6.0.0-canary.52",
6
6
  "author": "",
7
7
  "license": "MIT",
8
8
  "sideEffects": false,
@@ -18,18 +18,18 @@
18
18
  "@emotion/react": "^11.10.6",
19
19
  "@emotion/server": "^11.4.0",
20
20
  "@emotion/styled": "^11.10.6",
21
- "@graphcommerce/framer-next-pages": "6.0.0-canary.51",
22
- "@graphcommerce/framer-scroller": "6.0.0-canary.51",
23
- "@graphcommerce/framer-utils": "6.0.0-canary.51",
24
- "@graphcommerce/image": "6.0.0-canary.51",
21
+ "@graphcommerce/framer-next-pages": "6.0.0-canary.52",
22
+ "@graphcommerce/framer-scroller": "6.0.0-canary.52",
23
+ "@graphcommerce/framer-utils": "6.0.0-canary.52",
24
+ "@graphcommerce/image": "6.0.0-canary.52",
25
25
  "cookie": "^0.5.0",
26
26
  "react-is": "^18.2.0",
27
27
  "schema-dts": "^1.1.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@graphcommerce/eslint-config-pwa": "6.0.0-canary.51",
31
- "@graphcommerce/prettier-config-pwa": "6.0.0-canary.51",
32
- "@graphcommerce/typescript-config-pwa": "6.0.0-canary.51",
30
+ "@graphcommerce/eslint-config-pwa": "6.0.0-canary.52",
31
+ "@graphcommerce/prettier-config-pwa": "6.0.0-canary.52",
32
+ "@graphcommerce/typescript-config-pwa": "6.0.0-canary.52",
33
33
  "@types/cookie": "^0.5.1",
34
34
  "@types/react-is": "^17.0.3",
35
35
  "typescript": "4.9.5"