Mithril will instantiate it for each object in the HTTP response.</p>
<pre><code class=language-javascript>function User(data) {
    this.name = data.firstName + &quot; &quot; + data.lastName
}

m.request({
    method: &quot;GET&quot;,
    url: &quot;/api/v1/users&quot;,
    type: User
})
.then(function(users) {
    console.log(users[0].name) // logs a name
})</code></pre>
<p>In the example above, assuming <code>/api/v1/users</code> returns an array of objects, the <code>User</code> constructor will be inst