Libre and modular OSC / MIDI controller
Find a file
Matthijs Kooijman c5314fe17a custom-module: Call reload() function on auto-reload
This allows modules to re-initialize any state they need whenever the
module is reloaded.

Without this, any such initialization can also be done in the top
level of the custom module, but this has two problems:

 1. Top-level module code runs on load and reload, and for the initial
    load, it runs *before* the connections are set up, so trying to use
    send() would produce an error on load (not reload).

 2. Top-level module code runs for the primary custom module, but also
    for any nested modules, removing control about the process and
    ordering from the primary custom module. In addition, a module that
    can be used both as primary and nested module, there is no clean way
    to distinguish between these cases.

Both of these problems can be solved by doing some bookkeeping in the
global object, but that produces messy code.

This commit allows modules to define a reload() function, which is
called (for the primary module only) after the module is reloaded. This
means that any initialization for the first load can be done in init()
and for reloads in reload(), and in both cases all connections will
already have been set up solving issue 1. In addition, neither of these
functions are called for nested modules, solving issue 2 (and the
primary module can then stil explicitly call a reload function on nested
modules if needed, as shown in the examples).
2024-06-18 09:37:01 +02:00
.github github: ext browser may be firefox 2021-12-18 17:30:06 +01:00
app package: move html assets to src/ 2020-05-15 13:10:44 +02:00
resources custom-module: Call reload() function on auto-reload 2024-06-18 09:37:01 +02:00
scripts dev: fix hot reload 2023-09-08 18:14:34 +02:00
src custom-module: Call reload() function on auto-reload 2024-06-18 09:37:01 +02:00
tests widgets: add variable widget 2020-06-24 15:12:42 +02:00
.babelrc drop ios 9.3 2020-03-15 21:38:53 +01:00
.eslintrc.json lint 2024-04-03 10:01:05 +02:00
.gitignore package: upate most dependencies 2022-05-22 16:44:32 +02:00
.travis.yml packaging: move deb file before making rpm 2023-04-06 01:28:56 +02:00
CHANGELOG.md advanced syntaxes: display an error in the console in some unsupported advanced syntaxes use cases 2024-04-03 09:50:28 +02:00
CHANGELOG.v0.md fix typos 2020-07-27 16:04:14 +02:00
LICENSE doc & license file 2015-09-20 12:16:32 +02:00
package-lock.json package: update package.lock 2024-04-12 18:30:34 +02:00
package.json package: fix building with node <= 20 2024-04-12 18:30:06 +02:00
README.md docs: copyleft 2022 2022-07-04 13:16:50 +02:00

Open Stage Control

Open Stage Control

Libre and modular OSC / MIDI controller


Copyleft © Jean-Emmanuel Doucet @ AMMD 2014-2022. This program is a free software released under the GNU/GPL3 license.