DuyTa's picture
Upload folder using huggingface_hub
bc20498 verified
raw
history blame
704 Bytes
export function builderActions(node, params) {
const unsubs = [];
params.builders.forEach((builder) => {
const act = builder.action(node);
if (act) {
unsubs.push(act);
}
});
return {
destroy: () => {
unsubs.forEach((unsub) => {
if (unsub.destroy) {
unsub.destroy();
}
});
},
};
}
export function getAttrs(builders) {
const attrs = {};
builders.forEach((builder) => {
Object.keys(builder).forEach((key) => {
if (key !== "action") {
attrs[key] = builder[key];
}
});
});
return attrs;
}