Global Variable?

A mixin module of shared module @@ vars within the Plugin submodule.

The setup is just like the following example, but instead of constants in the shared mixin module, you define @@vars, and then use include(SharedVarsModule) in each of your 3rd level submodules.

When you mixin modules, it does not create new vars or constants in the mixee modules/classes. Instead it creates proxy lookups directly to the mixin module’s vars and constants. (The mixin module becomes a pseudo superclass to anything that includes it, and as such appears in the mixee’s ancestry chain.)

1 Like