@pmndrs/uikit
Version:
Build performant 3D user interfaces with Three.js and yoga.
9 lines (8 loc) • 460 B
JavaScript
import { computed } from '@preact/signals-core';
import { readReactive } from '../utils.js';
export function computedInheritableProperty(propertiesSignal, key, defaultValue) {
return computed(() => propertiesSignal.value.read(key, defaultValue));
}
export function computedNonInheritableProperty(style, properties, key, defaultValue) {
return computed(() => readReactive(style.value?.[key]) ?? readReactive(properties.value?.[key]) ?? defaultValue);
}