Mission Control Dashboard - Initial implementation
This commit is contained in:
21
node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs
generated
vendored
Normal file
21
node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { MotionGlobalConfig } from 'motion-utils';
|
||||
import { isWillChangeMotionValue } from './is.mjs';
|
||||
|
||||
function addValueToWillChange(visualElement, key) {
|
||||
const willChange = visualElement.getValue("willChange");
|
||||
/**
|
||||
* It could be that a user has set willChange to a regular MotionValue,
|
||||
* in which case we can't add the value to it.
|
||||
*/
|
||||
if (isWillChangeMotionValue(willChange)) {
|
||||
return willChange.add(key);
|
||||
}
|
||||
else if (!willChange && MotionGlobalConfig.WillChange) {
|
||||
const newWillChange = new MotionGlobalConfig.WillChange("auto");
|
||||
visualElement.addValue("willChange", newWillChange);
|
||||
newWillChange.add(key);
|
||||
}
|
||||
}
|
||||
|
||||
export { addValueToWillChange };
|
||||
//# sourceMappingURL=add-will-change.mjs.map
|
||||
Reference in New Issue
Block a user