Unload or reload a given module
Unload a given module or reload it from its source.
unload(mod) reload(mod)
mod |
the module reference to be unloaded or reloaded |
Unloading a module causes it to be purged from the internal cache such that
the next subsequent box::use declaration will reload the module from
its source. reload is a shortcut for unloading a module and calling
box::use in the same scope with the same parameters as the
box::use call that originally loaded the current module instance.
box::unload and box::reload are called for their
side-effect. They do not return anything.
Any other references to the loaded modules remain unchanged, and will still work. Unloading and reloading modules is primarily useful for testing during development, and should not be used in production code.
unload and reload come with a few restrictions. unload
attempts to detach names attached by the corresponding box::use call.
reload attempts to re-attach these same names. This only works if the
corresponding box::use declaration is located in the same scope.
reload will re-execute the .on_load hook of the module.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.