- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
20 lines
580 B
JavaScript
20 lines
580 B
JavaScript
import { collectMotionValues } from './index.mjs';
|
|
import { useCombineMotionValues } from './use-combine-values.mjs';
|
|
|
|
function useComputed(compute) {
|
|
/**
|
|
* Open session of collectMotionValues. Any MotionValue that calls get()
|
|
* will be saved into this array.
|
|
*/
|
|
collectMotionValues.current = [];
|
|
compute();
|
|
const value = useCombineMotionValues(collectMotionValues.current, compute);
|
|
/**
|
|
* Synchronously close session of collectMotionValues.
|
|
*/
|
|
collectMotionValues.current = undefined;
|
|
return value;
|
|
}
|
|
|
|
export { useComputed };
|