Observable

Observable variables can be added to widgets and when they are changed, it fires off a StateChanged event so you can react to it.

It is implemented as a getter and setter property, along with another helper you can use to subscribe with is name_changed. You can also subscribe to the StateChanged event through the usual means. Just give the name of the variable. See StateChanged for an example.

To get an ObservableReference to the observable, use &yourname_changed.

mixin template Observable (
T
string name
) {}

Meta

History

Moved from minigui_addons.webview to main minigui on November 27, 2021 (dub v10.4)

As of March 5, 2025, the changed function now returns an EventListener handle, which you can use to disconnect the observer.