UNPKG

@vime-js/utils

Version:
14 lines (11 loc) 303 B
export default function vIf(node, initialVisibility) { const update = (shouldDisplay) => { // eslint-disable-next-line no-param-reassign node.style.display = shouldDisplay ? null : 'none'; }; update(initialVisibility); return { update, destroy: () => { update(true); }, }; }