From 0a30a4a432e3405a94222806675f6076819cabfc Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 8 Oct 2019 21:11:55 +0200 Subject: DOCS: explicitly mention that property observing has an initial event This is definitely intended from the start, and it's generally useful, but for some reason it wasn't actually documented. --- DOCS/man/lua.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'DOCS') diff --git a/DOCS/man/lua.rst b/DOCS/man/lua.rst index 7be8960915..d3034f1113 100644 --- a/DOCS/man/lua.rst +++ b/DOCS/man/lua.rst @@ -344,12 +344,16 @@ The ``mp`` module is preloaded, although it can be loaded manually with exact behavior depends on timing and other things.) In some cases the function is not called even if the property changes. - Whether this can happen depends on the property. + This depends on the property, and it's a valid feature request to ask for + better update handling of a specific property. If the ``type`` is ``none`` or ``nil``, sporadic property change events are possible. This means the change function ``fn`` can be called even if the property doesn't actually change. + You always get an initial change notification. This is meant to initialize + the user's state to the current value of the property. + ``mp.unobserve_property(fn)`` Undo ``mp.observe_property(..., fn)``. This removes all property handlers that are equal to the ``fn`` parameter. This uses normal Lua ``==`` -- cgit v1.2.3