iews to avoid polluting the data layer with DOM event model concerns:</p>
<pre><code class="lang-javascript">var state = {
    email: &quot;&quot;,
    setEmail: function(email) {
        state.email = email.toLowerCase()
    }
}

var MyComponent = {
    view: function() {
        return m(&quot;input&quot;, {
            oninput: m.withAttr(&quot;value&quot;, state.setEmail),
            value: state.email
        })
    }
}

m.mount(document.body, MyComponent)
</code></pre>
<hr>
<h3 id="predictable-event-