Skip to content

Registry

Danny SMc edited this page Nov 2, 2021 · 2 revisions

The registry is a simple static class that contains all registered modules and any other data that is needed to run the application. You can access the registry from anywhere in the application by importing and calling it's static methods.

The Registry is cut up into two main sections, the module registration area, and the static variables area. The module registration area is where all engine modules get registered and the variables area is where we store all the static variables that are needed to run the application, like engine.mode which is whether the app is running in production or development based on the in-use file extension (.js = prod, .ts = dev).


Example (Vars)

Below is an example of calling the registry and getting the environment mode (dev/prod):

import { Registry } from '@symbux/turbo';

console.log(Registry.get('engine.mode'));

Example (Modules)

Below is an example of listing all modules and then retrieving the modules as a formatted array:

import { Registry } from '@symbux/turbo';

console.log(Registry.listModules());

Features

Plugins

Future Plans

Resources

Clone this wiki locally