View on GitHub

mo360-ftk

MO360 Frontend Toolkit: A toolkit for single page applications (SPA) based on React and Typescript that allows to extract single features into microfrontends.

API: <App>

 <App />

Main entry point to a WebApp. Binds a new dependency injection container to all children, and sets up some default dependencies.

This is a replacement for the previous “kernel” function.

Properties:

interface IAppProps {
    name: string;
    init?: (container: IDiContainer) => void | IDiContainer;
    config?: IConfigData;
}

name

name: string

A name for the app. This is i.e. used in interconnection where we communicate between different nested Apps (“swidgets”) and can use the name to determine the sending/receiving swidget. ___

init

init?: (container: IDiContainer) => void | IDiContainer

We allow an init function to be passed. The passed container already contains the default dependencies in its parent container, so those can be overridden. ___

config

config?: IConfigData

Configuration to be passed. If non is given, the default configuration will be used.

If given, the default configuration will be merged with the given configuration object using lodash’s recursive merge().

If the App is loaded as a swidget, the configuration from the parent host will be merged with the given config object.