UNPKG

@nwebui/react-niagara-px

Version:
25 lines 910 B
import { useComponent } from "@nwebui/react-niagara-core"; import { findConverter } from "../converters"; const ValueBinding = function ({ nativeBinding }) { const [comp] = useComponent(nativeBinding.gets("ord")); if (comp) { const widget = nativeBinding.parent; const converters = Array.from(nativeBinding.children((c) => c.is("baja:Converter"))); converters.forEach((c) => { try { const ctor = findConverter(c.type.toString()); if (!ctor) { throw new Error("Converter Not Found " + c.type); } const conv = new ctor(c); conv.convert(widget, comp); } catch (e) { console.error(e); } }); } return null; }; export default ValueBinding; //# sourceMappingURL=ValueBinding.js.map