react-bindings
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -5,3 +5,2 @@ "use strict"; | ||
const type_utils_1 = require("../binding-utils/type-utils"); | ||
const emptyValues = Object.freeze({}); | ||
const extractBindingDependencyValues = ({ bindings, namedBindingsKeys }) => { | ||
@@ -32,3 +31,3 @@ var _a; | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return | ||
return emptyValues; | ||
return undefined; | ||
} | ||
@@ -35,0 +34,0 @@ }; |
@@ -11,3 +11,2 @@ "use strict"; | ||
const use_binding_effect_1 = require("../../use-binding-effect/use-binding-effect"); | ||
const emptyDependencies = Object.freeze({}); | ||
/** A derived binding is a binding derived from zero or more other bindings */ | ||
@@ -26,3 +25,3 @@ const useDerivedBinding = (bindings, transformer, { id, deps, areInputValuesEqual, detectInputChanges = true, makeComparableInputValue, areOutputValuesEqual, detectOutputChanges = true, limitMode, limitMSec, limitType, priority, queue }) => { | ||
try { | ||
return transformer(dependencyValues, bindings !== null && bindings !== void 0 ? bindings : emptyDependencies); | ||
return transformer(dependencyValues, bindings !== null && bindings !== void 0 ? bindings : undefined); | ||
} | ||
@@ -29,0 +28,0 @@ finally { |
@@ -12,3 +12,2 @@ "use strict"; | ||
const use_binding_effect_1 = require("../use-binding-effect/use-binding-effect"); | ||
const emptyDependencies = Object.freeze({}); | ||
/** Use when a binding contains another binding, to listen to the second-level binding if either the first or second levels change */ | ||
@@ -26,3 +25,3 @@ const useFlattenedBinding = (bindings, transformer, { id, deps = [], areInputValuesEqual, detectInputChanges = true, makeComparableInputValue, areOutputValuesEqual, detectOutputChanges = true, | ||
const getDependencyValues = () => (0, extract_binding_dependency_values_1.extractBindingDependencyValues)({ bindings, namedBindingsKeys }); | ||
const internalBinding = (0, use_binding_1.useBinding)(() => transformer(getDependencyValues(), bindings !== null && bindings !== void 0 ? bindings : emptyDependencies).get(), { | ||
const internalBinding = (0, use_binding_1.useBinding)(() => transformer(getDependencyValues(), bindings !== null && bindings !== void 0 ? bindings : undefined).get(), { | ||
id, | ||
@@ -37,3 +36,3 @@ areEqual: areOutputValuesEqual, | ||
secondLevelBindingListenerRemover.current = undefined; | ||
const secondLevelBinding = transformer(dependencyValues, bindings !== null && bindings !== void 0 ? bindings : emptyDependencies); | ||
const secondLevelBinding = transformer(dependencyValues, bindings !== null && bindings !== void 0 ? bindings : undefined); | ||
internalBinding.set(secondLevelBinding.get()); | ||
@@ -50,3 +49,3 @@ if (isMounted.current) { | ||
(0, react_1.useEffect)(() => { | ||
const secondLevelBinding = transformer(getDependencyValues(), bindings !== null && bindings !== void 0 ? bindings : emptyDependencies); | ||
const secondLevelBinding = transformer(getDependencyValues(), bindings !== null && bindings !== void 0 ? bindings : undefined); | ||
secondLevelBindingListenerRemover.current = secondLevelBinding.addChangeListener(() => { | ||
@@ -53,0 +52,0 @@ internalBinding.set(secondLevelBinding.get()); |
{ | ||
"name": "react-bindings", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Data bindings for React", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
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
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
203326
2422