lifecycle methods to a fragment <a href="vnodes.html">vnode</a></p>
<pre><code class="lang-javascript">var groupVisible = true
var log = function() {
    console.log(&quot;group is now visible&quot;)
}

m(&quot;ul&quot;, [
    m(&quot;li&quot;, &quot;child 1&quot;),
    m(&quot;li&quot;, &quot;child 2&quot;),
    groupVisible ? m.fragment({oninit: log}, [
        // a fragment containing two elements
        m(&quot;li&quot;, &quot;child 3&quot;),
        m(&quot;li&quot;, &quot;child 4&quot;),
    ]) : nul