package miaou-core

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

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 ()
Sourceval request_render : unit -> unit

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.

Sourceval should_render : unit -> bool

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.

Sourceval clear : unit -> unit

Clear any pending render request without performing the render.

Useful for cleanup or when switching pages.