Hacker News new | ask | show | jobs
by tobyhinloopen 2866 days ago
Why include XHR in a view framework?
3 comments

You can use mithril.js without m.request, but then you have to dispatch redraw events when you finished handling the request[^1]. It also provides a promise API for web requests in old browsers, i.e. without fetch(). If I choose not to use m.request, I would have to find another XMLHttpRequest wrapper and bind it to Mithril.

[^1]: https://mithril.js.org/autoredraw.html#after-mrequest

It's a library for building webapps. Router and Ajax lib are a pretty obvious requirement for every webapp.
It's an MVC framework