@knocklabs/react-core 0.5.0-rc.1.0 → 0.5.0-rc.3.0

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,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## 0.5.0-rc.1.0
3
+ ## 0.5.0-rc.3.0
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -9,7 +9,7 @@
9
9
  ### Patch Changes
10
10
 
11
11
  - Updated dependencies [0fc5f2d]
12
- - @knocklabs/client@0.12.0-rc.1.0
12
+ - @knocklabs/client@0.12.0-rc.3.0
13
13
 
14
14
  ## 0.4.0
15
15
 
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("zustand");function n(e,t){const o=i.useStore(e.store);return u=>{const r=u??t;return r?r(o):o}}function s(e,t){return n(e,t)}exports.default=s;exports.useCreateNotificationStore=n;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("zustand");function r(e){return u=>n.useStore(e.store,u??(t=>t))}function s(e,o){return r(e)(o??(t=>t))}exports.default=s;exports.useCreateNotificationStore=r;
2
2
  //# sourceMappingURL=useNotificationStore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNotificationStore.js","sources":["../../../../../src/modules/feed/hooks/useNotificationStore.ts"],"sourcesContent":["import { Feed, type FeedStoreState } from \"@knocklabs/client\";\nimport { type StoreApi, type UseBoundStore, useStore } from \"zustand\";\n\n// A hook designed to create a `UseBoundStore` instance.\n// https://zustand.docs.pmnd.rs/guides/typescript#bounded-usestore-hook-for-vanilla-stores\nfunction useCreateNotificationStore(\n feedClient: Feed,\n): UseBoundStore<StoreApi<FeedStoreState>>;\nfunction useCreateNotificationStore<T, U = T>(\n feedClient: Feed,\n externalSelector: (state: FeedStoreState) => U,\n): U;\n/**\n * Access a Bounded Store instance\n * Allow passing a selector down from useCreateNotificationStore OR useNotificationStore\n * We'll favor the the one passed later outside of useCreateNotificationStore instantiation\n */\nfunction useCreateNotificationStore<T, U = T>(\n feedClient: Feed,\n externalSelector?: (state: FeedStoreState) => U,\n) {\n const store = useStore(feedClient.store);\n\n return (selector?: (state: FeedStoreState) => U) => {\n const innerSelector = selector ?? externalSelector;\n return innerSelector ? innerSelector(store) : store;\n };\n}\n\n/**\n * A hook used to access content within the notification store.\n *\n * A selector can be used to access a subset of the store state.\n *\n * @example\n *\n * ```ts\n * const { items, metadata } = useNotificationStore(feedClient, (state) => ({\n * items: state.items,\n * metadata: state.metadata,\n * }));\n * ```\n */\nfunction useNotificationStore(\n feedClient: Feed,\n): UseBoundStore<StoreApi<FeedStoreState>>;\nfunction useNotificationStore<T>(\n feedClient: Feed,\n selector: (state: FeedStoreState) => T,\n): T;\nfunction useNotificationStore<T, U = T>(\n feedClient: Feed,\n selector?: (state: FeedStoreState) => U,\n) {\n return useCreateNotificationStore(feedClient, selector!);\n}\n\nexport { useCreateNotificationStore };\nexport default useNotificationStore;\n"],"names":["useCreateNotificationStore","feedClient","externalSelector","store","useStore","selector","innerSelector","useNotificationStore"],"mappings":"uIAiBA,SAASA,EACPC,EACAC,EACA,CACMC,MAAAA,EAAQC,EAAAA,SAASH,EAAWE,KAAK,EAEvC,OAAQE,GAA4C,CAClD,MAAMC,EAAgBD,GAAYH,EAC3BI,OAAAA,EAAgBA,EAAcH,CAAK,EAAIA,CAChD,CACF,CAuBA,SAASI,EACPN,EACAI,EACA,CACOL,OAAAA,EAA2BC,EAAYI,CAAS,CACzD"}
1
+ {"version":3,"file":"useNotificationStore.js","sources":["../../../../../src/modules/feed/hooks/useNotificationStore.ts"],"sourcesContent":["import { Feed, type FeedStoreState } from \"@knocklabs/client\";\nimport { type StoreApi, type UseBoundStore, useStore } from \"zustand\";\n\nexport type Selector<T> = (state: FeedStoreState) => T;\n\n/**\n * Access a Bounded Store instance by converting our vanilla store to a UseBoundStore\n * https://zustand.docs.pmnd.rs/guides/typescript#bounded-usestore-hook-for-vanilla-stores\n * Allow passing a selector down from useCreateNotificationStore OR useNotificationStore\n * We'll favor the the one passed later outside of useCreateNotificationStore instantiation\n */\nfunction useCreateNotificationStore<T>(\n feedClient: Feed,\n): UseBoundStore<StoreApi<FeedStoreState>> {\n // Keep selector optional for external use\n // useStore requires a selector so we'll pass in a default one when not provided\n const useBoundedStore = (selector?: Selector<T>) =>\n useStore(feedClient.store, selector ?? ((state) => state as T));\n return useBoundedStore as UseBoundStore<StoreApi<FeedStoreState>>;\n}\n\n/**\n * A hook used to access content within the notification store.\n *\n * @example\n *\n * ```ts\n * const { items, metadata } = useNotificationStore(feedClient);\n * ```\n *\n * A selector can be used to access a subset of the store state.\n *\n * @example\n *\n * ```ts\n * const { items, metadata } = useNotificationStore(feedClient, (state) => ({\n * items: state.items,\n * metadata: state.metadata,\n * }));\n * ```\n */\nfunction useNotificationStore(feedClient: Feed): FeedStoreState;\nfunction useNotificationStore<T>(feedClient: Feed, selector: Selector<T>): T;\nfunction useNotificationStore<T>(\n feedClient: Feed,\n selector?: Selector<T>,\n): T | FeedStoreState {\n const useStoreLocal = useCreateNotificationStore(feedClient);\n return useStoreLocal(selector ?? ((state) => state as T));\n}\n\nexport { useCreateNotificationStore };\nexport default useNotificationStore;\n"],"names":["useCreateNotificationStore","feedClient","useBoundedStore","selector","useStore","store","state","useNotificationStore","useStoreLocal"],"mappings":"uIAWA,SAASA,EACPC,EACyC,CAKlCC,OAFkBC,GACvBC,WAASH,EAAWI,MAAOF,OAAwBG,EAAW,CAElE,CAwBA,SAASC,EACPN,EACAE,EACoB,CAEbK,OADeR,EAA2BC,CAAU,EACtCE,IAAcG,GAAUA,EAAW,CAC1D"}
@@ -1,16 +1,12 @@
1
- import { useStore as i } from "zustand";
2
- function u(t, e) {
3
- const o = i(t.store);
4
- return (n) => {
5
- const r = n ?? e;
6
- return r ? r(o) : o;
7
- };
1
+ import { useStore as u } from "zustand";
2
+ function n(e) {
3
+ return (r) => u(e.store, r ?? ((o) => o));
8
4
  }
9
- function c(t, e) {
10
- return u(t, e);
5
+ function i(e, t) {
6
+ return n(e)(t ?? ((o) => o));
11
7
  }
12
8
  export {
13
- c as default,
14
- u as useCreateNotificationStore
9
+ i as default,
10
+ n as useCreateNotificationStore
15
11
  };
16
12
  //# sourceMappingURL=useNotificationStore.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNotificationStore.mjs","sources":["../../../../../src/modules/feed/hooks/useNotificationStore.ts"],"sourcesContent":["import { Feed, type FeedStoreState } from \"@knocklabs/client\";\nimport { type StoreApi, type UseBoundStore, useStore } from \"zustand\";\n\n// A hook designed to create a `UseBoundStore` instance.\n// https://zustand.docs.pmnd.rs/guides/typescript#bounded-usestore-hook-for-vanilla-stores\nfunction useCreateNotificationStore(\n feedClient: Feed,\n): UseBoundStore<StoreApi<FeedStoreState>>;\nfunction useCreateNotificationStore<T, U = T>(\n feedClient: Feed,\n externalSelector: (state: FeedStoreState) => U,\n): U;\n/**\n * Access a Bounded Store instance\n * Allow passing a selector down from useCreateNotificationStore OR useNotificationStore\n * We'll favor the the one passed later outside of useCreateNotificationStore instantiation\n */\nfunction useCreateNotificationStore<T, U = T>(\n feedClient: Feed,\n externalSelector?: (state: FeedStoreState) => U,\n) {\n const store = useStore(feedClient.store);\n\n return (selector?: (state: FeedStoreState) => U) => {\n const innerSelector = selector ?? externalSelector;\n return innerSelector ? innerSelector(store) : store;\n };\n}\n\n/**\n * A hook used to access content within the notification store.\n *\n * A selector can be used to access a subset of the store state.\n *\n * @example\n *\n * ```ts\n * const { items, metadata } = useNotificationStore(feedClient, (state) => ({\n * items: state.items,\n * metadata: state.metadata,\n * }));\n * ```\n */\nfunction useNotificationStore(\n feedClient: Feed,\n): UseBoundStore<StoreApi<FeedStoreState>>;\nfunction useNotificationStore<T>(\n feedClient: Feed,\n selector: (state: FeedStoreState) => T,\n): T;\nfunction useNotificationStore<T, U = T>(\n feedClient: Feed,\n selector?: (state: FeedStoreState) => U,\n) {\n return useCreateNotificationStore(feedClient, selector!);\n}\n\nexport { useCreateNotificationStore };\nexport default useNotificationStore;\n"],"names":["useCreateNotificationStore","feedClient","externalSelector","store","useStore","selector","innerSelector","useNotificationStore"],"mappings":";AAiBA,SAASA,EACPC,GACAC,GACA;AACMC,QAAAA,IAAQC,EAASH,EAAWE,KAAK;AAEvC,SAAO,CAACE,MAA4C;AAClD,UAAMC,IAAgBD,KAAYH;AAC3BI,WAAAA,IAAgBA,EAAcH,CAAK,IAAIA;AAAAA,EAChD;AACF;AAuBA,SAASI,EACPN,GACAI,GACA;AACOL,SAAAA,EAA2BC,GAAYI,CAAS;AACzD;"}
1
+ {"version":3,"file":"useNotificationStore.mjs","sources":["../../../../../src/modules/feed/hooks/useNotificationStore.ts"],"sourcesContent":["import { Feed, type FeedStoreState } from \"@knocklabs/client\";\nimport { type StoreApi, type UseBoundStore, useStore } from \"zustand\";\n\nexport type Selector<T> = (state: FeedStoreState) => T;\n\n/**\n * Access a Bounded Store instance by converting our vanilla store to a UseBoundStore\n * https://zustand.docs.pmnd.rs/guides/typescript#bounded-usestore-hook-for-vanilla-stores\n * Allow passing a selector down from useCreateNotificationStore OR useNotificationStore\n * We'll favor the the one passed later outside of useCreateNotificationStore instantiation\n */\nfunction useCreateNotificationStore<T>(\n feedClient: Feed,\n): UseBoundStore<StoreApi<FeedStoreState>> {\n // Keep selector optional for external use\n // useStore requires a selector so we'll pass in a default one when not provided\n const useBoundedStore = (selector?: Selector<T>) =>\n useStore(feedClient.store, selector ?? ((state) => state as T));\n return useBoundedStore as UseBoundStore<StoreApi<FeedStoreState>>;\n}\n\n/**\n * A hook used to access content within the notification store.\n *\n * @example\n *\n * ```ts\n * const { items, metadata } = useNotificationStore(feedClient);\n * ```\n *\n * A selector can be used to access a subset of the store state.\n *\n * @example\n *\n * ```ts\n * const { items, metadata } = useNotificationStore(feedClient, (state) => ({\n * items: state.items,\n * metadata: state.metadata,\n * }));\n * ```\n */\nfunction useNotificationStore(feedClient: Feed): FeedStoreState;\nfunction useNotificationStore<T>(feedClient: Feed, selector: Selector<T>): T;\nfunction useNotificationStore<T>(\n feedClient: Feed,\n selector?: Selector<T>,\n): T | FeedStoreState {\n const useStoreLocal = useCreateNotificationStore(feedClient);\n return useStoreLocal(selector ?? ((state) => state as T));\n}\n\nexport { useCreateNotificationStore };\nexport default useNotificationStore;\n"],"names":["useCreateNotificationStore","feedClient","useBoundedStore","selector","useStore","store","state","useNotificationStore","useStoreLocal"],"mappings":";AAWA,SAASA,EACPC,GACyC;AAKlCC,SAFiBA,CAACC,MACvBC,EAASH,EAAWI,OAAOF,MAAcG,OAAUA,EAAW;AAElE;AAwBA,SAASC,EACPN,GACAE,GACoB;AAEbK,SADeR,EAA2BC,CAAU,EACtCE,MAAcG,CAAAA,MAAUA,EAAW;AAC1D;"}
@@ -1,4 +1,4 @@
1
1
  export { default as useNotifications } from './useNotifications';
2
2
  export { default as useFeedSettings } from './useFeedSettings';
3
- export { default as useNotificationStore, useCreateNotificationStore, } from './useNotificationStore';
3
+ export { default as useNotificationStore, useCreateNotificationStore, type Selector, } from './useNotificationStore';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/feed/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,OAAO,IAAI,oBAAoB,EAC/B,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/feed/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,OAAO,IAAI,oBAAoB,EAC/B,0BAA0B,EAC1B,KAAK,QAAQ,GACd,MAAM,wBAAwB,CAAC"}
@@ -1,10 +1,22 @@
1
1
  import { Feed, FeedStoreState } from '@knocklabs/client';
2
2
  import { StoreApi, UseBoundStore } from 'zustand';
3
- declare function useCreateNotificationStore(feedClient: Feed): UseBoundStore<StoreApi<FeedStoreState>>;
4
- declare function useCreateNotificationStore<T, U = T>(feedClient: Feed, externalSelector: (state: FeedStoreState) => U): U;
3
+ export type Selector<T> = (state: FeedStoreState) => T;
4
+ /**
5
+ * Access a Bounded Store instance by converting our vanilla store to a UseBoundStore
6
+ * https://zustand.docs.pmnd.rs/guides/typescript#bounded-usestore-hook-for-vanilla-stores
7
+ * Allow passing a selector down from useCreateNotificationStore OR useNotificationStore
8
+ * We'll favor the the one passed later outside of useCreateNotificationStore instantiation
9
+ */
10
+ declare function useCreateNotificationStore<T>(feedClient: Feed): UseBoundStore<StoreApi<FeedStoreState>>;
5
11
  /**
6
12
  * A hook used to access content within the notification store.
7
13
  *
14
+ * @example
15
+ *
16
+ * ```ts
17
+ * const { items, metadata } = useNotificationStore(feedClient);
18
+ * ```
19
+ *
8
20
  * A selector can be used to access a subset of the store state.
9
21
  *
10
22
  * @example
@@ -16,8 +28,8 @@ declare function useCreateNotificationStore<T, U = T>(feedClient: Feed, external
16
28
  * }));
17
29
  * ```
18
30
  */
19
- declare function useNotificationStore(feedClient: Feed): UseBoundStore<StoreApi<FeedStoreState>>;
20
- declare function useNotificationStore<T>(feedClient: Feed, selector: (state: FeedStoreState) => T): T;
31
+ declare function useNotificationStore(feedClient: Feed): FeedStoreState;
32
+ declare function useNotificationStore<T>(feedClient: Feed, selector: Selector<T>): T;
21
33
  export { useCreateNotificationStore };
22
34
  export default useNotificationStore;
23
35
  //# sourceMappingURL=useNotificationStore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNotificationStore.d.ts","sourceRoot":"","sources":["../../../../../src/modules/feed/hooks/useNotificationStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAY,MAAM,SAAS,CAAC;AAItE,iBAAS,0BAA0B,CACjC,UAAU,EAAE,IAAI,GACf,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;AAC3C,iBAAS,0BAA0B,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAC1C,UAAU,EAAE,IAAI,EAChB,gBAAgB,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,CAAC,GAC7C,CAAC,CAAC;AAkBL;;;;;;;;;;;;;GAaG;AACH,iBAAS,oBAAoB,CAC3B,UAAU,EAAE,IAAI,GACf,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;AAC3C,iBAAS,oBAAoB,CAAC,CAAC,EAC7B,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,CAAC,GACrC,CAAC,CAAC;AAQL,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"useNotificationStore.d.ts","sourceRoot":"","sources":["../../../../../src/modules/feed/hooks/useNotificationStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAY,MAAM,SAAS,CAAC;AAEtE,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,cAAc,KAAK,CAAC,CAAC;AAEvD;;;;;GAKG;AACH,iBAAS,0BAA0B,CAAC,CAAC,EACnC,UAAU,EAAE,IAAI,GACf,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAMzC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,oBAAoB,CAAC,UAAU,EAAE,IAAI,GAAG,cAAc,CAAC;AAChE,iBAAS,oBAAoB,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAS7E,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,eAAe,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@knocklabs/react-core",
3
3
  "description": "A set of React components to build notification experiences powered by Knock",
4
4
  "author": "@knocklabs",
5
- "version": "0.5.0-rc.1.0",
5
+ "version": "0.5.0-rc.3.0",
6
6
  "license": "MIT",
7
7
  "main": "dist/cjs/index.js",
8
8
  "module": "dist/esm/index.mjs",
@@ -49,7 +49,7 @@
49
49
  "react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
50
50
  },
51
51
  "dependencies": {
52
- "@knocklabs/client": "^0.12.0-rc.1.0",
52
+ "@knocklabs/client": "^0.12.0-rc.3.0",
53
53
  "date-fns": "^4.0.0",
54
54
  "swr": "^2.3.2",
55
55
  "zustand": "^4.5.6"
@@ -3,4 +3,5 @@ export { default as useFeedSettings } from "./useFeedSettings";
3
3
  export {
4
4
  default as useNotificationStore,
5
5
  useCreateNotificationStore,
6
+ type Selector,
6
7
  } from "./useNotificationStore";
@@ -1,35 +1,33 @@
1
1
  import { Feed, type FeedStoreState } from "@knocklabs/client";
2
2
  import { type StoreApi, type UseBoundStore, useStore } from "zustand";
3
3
 
4
- // A hook designed to create a `UseBoundStore` instance.
5
- // https://zustand.docs.pmnd.rs/guides/typescript#bounded-usestore-hook-for-vanilla-stores
6
- function useCreateNotificationStore(
7
- feedClient: Feed,
8
- ): UseBoundStore<StoreApi<FeedStoreState>>;
9
- function useCreateNotificationStore<T, U = T>(
10
- feedClient: Feed,
11
- externalSelector: (state: FeedStoreState) => U,
12
- ): U;
4
+ export type Selector<T> = (state: FeedStoreState) => T;
5
+
13
6
  /**
14
- * Access a Bounded Store instance
7
+ * Access a Bounded Store instance by converting our vanilla store to a UseBoundStore
8
+ * https://zustand.docs.pmnd.rs/guides/typescript#bounded-usestore-hook-for-vanilla-stores
15
9
  * Allow passing a selector down from useCreateNotificationStore OR useNotificationStore
16
10
  * We'll favor the the one passed later outside of useCreateNotificationStore instantiation
17
11
  */
18
- function useCreateNotificationStore<T, U = T>(
12
+ function useCreateNotificationStore<T>(
19
13
  feedClient: Feed,
20
- externalSelector?: (state: FeedStoreState) => U,
21
- ) {
22
- const store = useStore(feedClient.store);
23
-
24
- return (selector?: (state: FeedStoreState) => U) => {
25
- const innerSelector = selector ?? externalSelector;
26
- return innerSelector ? innerSelector(store) : store;
27
- };
14
+ ): UseBoundStore<StoreApi<FeedStoreState>> {
15
+ // Keep selector optional for external use
16
+ // useStore requires a selector so we'll pass in a default one when not provided
17
+ const useBoundedStore = (selector?: Selector<T>) =>
18
+ useStore(feedClient.store, selector ?? ((state) => state as T));
19
+ return useBoundedStore as UseBoundStore<StoreApi<FeedStoreState>>;
28
20
  }
29
21
 
30
22
  /**
31
23
  * A hook used to access content within the notification store.
32
24
  *
25
+ * @example
26
+ *
27
+ * ```ts
28
+ * const { items, metadata } = useNotificationStore(feedClient);
29
+ * ```
30
+ *
33
31
  * A selector can be used to access a subset of the store state.
34
32
  *
35
33
  * @example
@@ -41,18 +39,14 @@ function useCreateNotificationStore<T, U = T>(
41
39
  * }));
42
40
  * ```
43
41
  */
44
- function useNotificationStore(
45
- feedClient: Feed,
46
- ): UseBoundStore<StoreApi<FeedStoreState>>;
42
+ function useNotificationStore(feedClient: Feed): FeedStoreState;
43
+ function useNotificationStore<T>(feedClient: Feed, selector: Selector<T>): T;
47
44
  function useNotificationStore<T>(
48
45
  feedClient: Feed,
49
- selector: (state: FeedStoreState) => T,
50
- ): T;
51
- function useNotificationStore<T, U = T>(
52
- feedClient: Feed,
53
- selector?: (state: FeedStoreState) => U,
54
- ) {
55
- return useCreateNotificationStore(feedClient, selector!);
46
+ selector?: Selector<T>,
47
+ ): T | FeedStoreState {
48
+ const useStoreLocal = useCreateNotificationStore(feedClient);
49
+ return useStoreLocal(selector ?? ((state) => state as T));
56
50
  }
57
51
 
58
52
  export { useCreateNotificationStore };