package miaou-core
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6
doc/miaou-core.helpers/Miaou_helpers/Render_notify/index.html
Module Miaou_helpers.Render_notifySource
Global render notification system for widgets.
This module provides a simple mechanism for widgets to request a UI re-render when they need to update asynchronously (e.g., after a debounce delay, animation frame, or background task completion).
For Widgets
Call request_render when you need the UI to refresh:
(* After setting up a delayed validation *)
Render_notify.request_render ()For Drivers
Check should_render in your event loop and perform a render if needed:
if Render_notify.should_render () then
perform_render ()Request a UI re-render.
This is a non-blocking call that sets a flag indicating the UI should refresh. Multiple calls before the next render are coalesced.
Thread-safe: can be called from any thread or fiber.
Check if a render was requested and clear the flag.
Returns true if request_render was called since the last check. The flag is automatically cleared, so subsequent calls return false until another request_render is made.
Thread-safe: can be called from any thread.
Clear any pending render request without performing the render.
Useful for cleanup or when switching pages.