@rfkit/charts 1.0.90 → 1.0.92
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/index.js +7 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -4829,6 +4829,9 @@ const store = Store;
|
|
|
4829
4829
|
const PUB_SUB = (globalID, func)=>subscription_createSubscriptionManager(`PUB_SUB-${globalID}`, '0', func);
|
|
4830
4830
|
const usePublish = ({ publish = ()=>{}, subscribe = ()=>{} })=>{
|
|
4831
4831
|
const { state: { globalID }, dispatch } = useStore_useStore();
|
|
4832
|
+
const getSourceData = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)(()=>withDatabase(globalID), [
|
|
4833
|
+
globalID
|
|
4834
|
+
]);
|
|
4832
4835
|
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
|
|
4833
4836
|
if (globalID) PUB_SUB(globalID, subscribe);
|
|
4834
4837
|
}, [
|
|
@@ -4837,12 +4840,14 @@ const usePublish = ({ publish = ()=>{}, subscribe = ()=>{} })=>{
|
|
|
4837
4840
|
]);
|
|
4838
4841
|
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
|
|
4839
4842
|
if (globalID) {
|
|
4843
|
+
const p = PUB_SUB(globalID);
|
|
4840
4844
|
dispatch({
|
|
4841
4845
|
payload: {
|
|
4842
|
-
publish:
|
|
4846
|
+
publish: p
|
|
4843
4847
|
}
|
|
4844
4848
|
});
|
|
4845
|
-
publish?.(
|
|
4849
|
+
publish?.(p);
|
|
4850
|
+
publish.getSourceData = getSourceData;
|
|
4846
4851
|
}
|
|
4847
4852
|
}, [
|
|
4848
4853
|
JSON.stringify(publish),
|