Mission Control Dashboard - Initial implementation
This commit is contained in:
14
node_modules/motion-dom/dist/es/value/subscribe-value.mjs
generated
vendored
Normal file
14
node_modules/motion-dom/dist/es/value/subscribe-value.mjs
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { cancelFrame, frame } from '../frameloop/frame.mjs';
|
||||
|
||||
function subscribeValue(inputValues, outputValue, getLatest) {
|
||||
const update = () => outputValue.set(getLatest());
|
||||
const scheduleUpdate = () => frame.preRender(update, false, true);
|
||||
const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate));
|
||||
outputValue.on("destroy", () => {
|
||||
subscriptions.forEach((unsubscribe) => unsubscribe());
|
||||
cancelFrame(update);
|
||||
});
|
||||
}
|
||||
|
||||
export { subscribeValue };
|
||||
//# sourceMappingURL=subscribe-value.mjs.map
|
||||
Reference in New Issue
Block a user