Using Mithril’s m.request for AJAX Calls and Automatic Redraw
Learn how to fetch JSON with m.request, let Mithril redraw automatically, and avoid common pitfalls.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to fetch JSON with m.request, let Mithril redraw automatically, and avoid common pitfalls.
Learn how Mithril’s m.request simplifies AJAX calls with automatic method selection, unified error handling, and optional custom deserialization, plus practical tips for background requests and error safety.
Choose between local component properties and shared store objects in Mithril.js to maintain UI synchronization without sacrificing performance.
Mithril’s <code>m.stream</code> is a lightweight, zero‑dependency solution for reactive state. Learn how it works, see a counter example, and understand when it’s the right choice for your app.
Use Mithril's built-in m.stream for local component state to avoid external stores. Learn the API, redraw integration, a debounced search pattern with cleanup, and when streams are not enough.
How to fetch and post JSON in a Mithril SPA using m.request: correct config keys, explicit HTTP error handling with extract, and what Mithril deliberately does not manage for you.
An architecture note on building a Mithril SPA with just m.route resolvers and the auto-redraw system: requirements, trust boundaries, failure modes, and verification checks.
Explore how Mithril’s auto‑redraw wraps async work, schedules updates with requestAnimationFrame, and lets developers control redraw frequency for performance.
Learn how to use Mithril's oncreate hook to safely handle imperative DOM tasks like focusing inputs and initializing third-party libraries without blocking the UI.