elbe-ui 1.0.2 → 1.0.4
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.
|
@@ -112,7 +112,18 @@ export function _makeBitProvider(context, bitP) {
|
|
|
112
112
|
const ctrl = useMemo(() => _make(), [state]);
|
|
113
113
|
useEffect(() => {
|
|
114
114
|
ctrl.reload(true);
|
|
115
|
-
|
|
115
|
+
return () => {
|
|
116
|
+
const d = ctrl.dispose;
|
|
117
|
+
if (typeof d !== "function")
|
|
118
|
+
return;
|
|
119
|
+
try {
|
|
120
|
+
d();
|
|
121
|
+
}
|
|
122
|
+
catch (_a) {
|
|
123
|
+
// ignore errors during dispose
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}, [ctrl]);
|
|
116
127
|
// ========== DEFINE THE JSX ELEMENT ==========
|
|
117
128
|
return _jsx(context.Provider, { value: ctrl, children: p.children });
|
|
118
129
|
}
|
package/dist/bit/bit.js
CHANGED
|
@@ -18,7 +18,6 @@ export function createBit(_a) {
|
|
|
18
18
|
return {
|
|
19
19
|
Provider: _makeBitProvider(context, Object.assign(Object.assign({}, p), { control })),
|
|
20
20
|
use: () => {
|
|
21
|
-
console.log("use", p.debugLabel);
|
|
22
21
|
const ctx = useContext(context);
|
|
23
22
|
if (!ctx) {
|
|
24
23
|
throw new Error(`BIT ERROR: NO ${p.debugLabel} PROVIDED`);
|