@gem-sdk/core 1.8.26 → 1.8.28
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.
|
@@ -5,8 +5,13 @@ var react = require('react');
|
|
|
5
5
|
var zustand = require('zustand');
|
|
6
6
|
|
|
7
7
|
const CollectionContext = /*#__PURE__*/ react.createContext(null);
|
|
8
|
-
const createCollectionProvider = (data)=>zustand.createStore(()=>({
|
|
9
|
-
...data
|
|
8
|
+
const createCollectionProvider = (data)=>zustand.createStore((set)=>({
|
|
9
|
+
...data,
|
|
10
|
+
changeCollectionStore: ({ collection })=>{
|
|
11
|
+
set({
|
|
12
|
+
collection: collection
|
|
13
|
+
});
|
|
14
|
+
}
|
|
10
15
|
}));
|
|
11
16
|
const CollectionProvider = ({ collection , children })=>{
|
|
12
17
|
const store = react.useMemo(()=>{
|
|
@@ -3,8 +3,13 @@ import { useMemo, useContext, createContext } from 'react';
|
|
|
3
3
|
import { useStore, createStore } from 'zustand';
|
|
4
4
|
|
|
5
5
|
const CollectionContext = /*#__PURE__*/ createContext(null);
|
|
6
|
-
const createCollectionProvider = (data)=>createStore(()=>({
|
|
7
|
-
...data
|
|
6
|
+
const createCollectionProvider = (data)=>createStore((set)=>({
|
|
7
|
+
...data,
|
|
8
|
+
changeCollectionStore: ({ collection })=>{
|
|
9
|
+
set({
|
|
10
|
+
collection: collection
|
|
11
|
+
});
|
|
12
|
+
}
|
|
8
13
|
}));
|
|
9
14
|
const CollectionProvider = ({ collection , children })=>{
|
|
10
15
|
const store = useMemo(()=>{
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7036,6 +7036,9 @@ type CollectionSelectFragment = Pick<Collection, 'id' | 'createdAt' | 'updatedAt
|
|
|
7036
7036
|
|
|
7037
7037
|
type CollectionContextProps = {
|
|
7038
7038
|
collection?: CollectionSelectFragment;
|
|
7039
|
+
changeCollectionStore: (args: {
|
|
7040
|
+
collection?: CollectionSelectFragment;
|
|
7041
|
+
}) => void;
|
|
7039
7042
|
};
|
|
7040
7043
|
type CollectionProviderProps = Pick<CollectionContextProps, 'collection'> & {
|
|
7041
7044
|
initialVariantId?: string;
|