@knocklabs/react-core
Advanced tools
Comparing version 0.2.18 to 0.2.19
# Changelog | ||
## 0.2.19 | ||
### Patch Changes | ||
- 1e60c19: fix: re-introduce subscribe/setstate call for useNotifications | ||
## 0.2.18 | ||
@@ -4,0 +10,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";const s=require("react");require("../../core/context/KnockProvider.js");require("@knocklabs/client");const n=require("../../core/hooks/useStableOptions.js");require("date-fns");function c(r,t,u={}){const e=s.useRef(),i=n(u);return s.useMemo(()=>(e.current&&e.current.dispose(),e.current=r.feeds.initialize(t,i),e.current.listenForUpdates(),e.current),[r,t,i])}module.exports=c; | ||
"use strict";const i=require("react");require("../../core/context/KnockProvider.js");require("@knocklabs/client");const o=require("../../core/hooks/useStableOptions.js");require("date-fns");function a(r,t,n={}){const e=i.useRef(),s=o(n);return i.useMemo(()=>(e.current&&e.current.dispose(),e.current=r.feeds.initialize(t,s),e.current.store.subscribe(c=>{var u;return(u=e==null?void 0:e.current)==null?void 0:u.store.setState(c)}),e.current.listenForUpdates(),e.current),[r,t,s])}module.exports=a; | ||
//# sourceMappingURL=useNotifications.js.map |
@@ -5,3 +5,3 @@ { | ||
"author": "@knocklabs", | ||
"version": "0.2.18", | ||
"version": "0.2.19", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "main": "dist/cjs/index.js", |
@@ -24,2 +24,8 @@ import Knock, { Feed, FeedClientOptions } from "@knocklabs/client"; | ||
// In development, we need to introduce this extra set state to force a render | ||
// for Zustand as otherwise the state doesn't get reflected correctly | ||
feedClientRef.current.store.subscribe((t) => | ||
feedClientRef?.current?.store.setState(t), | ||
); | ||
feedClientRef.current.listenForUpdates(); | ||
@@ -26,0 +32,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
205928
1951