micro-observables
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -13,7 +13,7 @@ "use strict"; | ||
function useObservable(observable) { | ||
var _a = react_1.useState(observable.get()), val = _a[0], setVal = _a[1]; | ||
var _a = react_1.useState(), forceUpdate = _a[1]; | ||
react_1.useEffect(function () { | ||
return observable.onChange(function (newVal) { return setVal(newVal); }); | ||
return observable.onChange(forceUpdate); | ||
}, [observable]); | ||
return val; | ||
return observable.get(); | ||
} | ||
@@ -20,0 +20,0 @@ exports.useObservable = useObservable; |
{ | ||
"name": "micro-observables", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
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
22857