<commit_before>// export * from 'domvm/dist/dev/domvm.dev.js';
export * from 'domvm/dist/mini/domvm.mini.js';
import { call } from 'frptools';
import { deepAssign } from './conversion.js';
import { error } from '../services/console.js';

export function subscribeToRender(vm, subscribables, subscriptions) {
    const redraw = (...args) => vm.redraw();
    const subList = subscribables
        .map(s => s.subscribe(redraw))
        .concat(subscriptions);

    vm.config({ hooks: { willUnmount: () => subList.forEach(call)}});
}


export function patchRefStyle(ref, style, evt, node, vm) {
    vm.refs[ref].patch({style});
}

export function patchRefStyleMap(refStyleMap, ...args) {
    Object.entries(refStyleMap).forEach(([r, s]) => patchRefStyle(r, s, ...args))<commit_msg>Lazyify iterating subscriptions array un subscribeToRender<commit_after>// export * from 'domvm/dist/dev/domvm.dev.js';
export * from 'domvm/dist/mini/domvm.mini.js';
import { call } from 'frptools';
import { deepAssign } from './conversion.js';
import { error } from '../services/console.js';

export function subscribeToRender(vm, subscribables, subscriptions) {
    const redraw = (...args) => vm.redraw();
    const subList = subscribables
        .map(s => s.subscribe(redraw));

    vm.config({ hooks: {
        willUnmount: () => subList.concat(subscriptions).forEach(call)
    }});
}


export function patchRefStyle(ref, style, evt, node, vm) {
    vm.refs[ref].patch({style});
}

export function patchRefStyleMap(refStyleMap, ...args) {
    Object.entries(refStyleMap).forEach(([r, s]) => patchRefStyle(r, s, ...args))
{'fraction_non_alphanumeric': 0.17196261682242991, 'fraction_numerical': 0.0, 'mean_word_length': 4.01875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2346375', 'n_tokens_mistral': 531, 'n_tokens_neox': 513, 'n_words': 113}