data layer. This can be as simple as creating a new module:</p>
<pre><code class="lang-javascript">// models/Auth.js
// PREFER
var Auth = {
    username: &quot;&quot;,
    password: &quot;&quot;,
    setUsername: function(value) {
        Auth.username = value
    },
    setPassword: function(value) {
        Auth.password = value
    },
    canSubmit: function() {
        return Auth.username !== &quot;&quot; &amp;&amp; Auth.password !== &quot;&quot;
    },
    login: function() {/*...*/},
}

module.export