TOC
tbd.
window.registerComponent(
'Absolute/Path/To/Item',
[
'Absolute/Path/To/Single/Dependency/1',
'Absolute/Path/To/Single/Dependency/2',
// ... and so on
'system/global/state' // the global store is used as an import
],
([
Dependency1,
Dependency2,
//... and so on
globalState,
]) => {
return functionToBeExecutedWhileRendering(
props,
children,
[state, setState] // the locally used, component-centric state is ALWAYS the last parameter!
) => {
return createTag(
// explained below
);
}
}
);
window.registerUtil(
'Absolute/Path/To/Item',
[
'Absolute/Path/To/Single/Dependency/1',
'Absolute/Path/To/Single/Dependency/2',
...
],
([ ObjectContainingAllDependencies ]) => {
return functionToBeExecuted(params) => {
return 'any return-value';
}
// or
var configurationObject = {
item1: 'Value',
item2: 'Value',
};
return configurationObject;
}
);
The UI Components are built with React and StyledComponents. All source code is written in TypeScript.
window.registerComponent(
'Absolute/Path/To/Component',
[
'Absolute/Path/To/Dependency',
],
([ ObjectContainingAllDependencies ]) => {
...
}
);
window.registerComponent(
'./modules/Water/Water',
[
'./constants/constants',
],
([ { tileStyles } ]) => {
...
}
);