Combines the following repositories into one: https://github.com/mattermost/mattermost-server https://github.com/mattermost/mattermost-webapp https://github.com/mattermost/focalboard https://github.com/mattermost/mattermost-plugin-playbooks
18 строки
409 B
TypeScript
18 строки
409 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
const modules: Record<string, unknown> = {};
|
|
|
|
export const getModule = <T>(name: string) => {
|
|
return modules[name] as T;
|
|
};
|
|
|
|
export const setModule = <T>(name: string, component: T) => {
|
|
if (modules[name]) {
|
|
return false;
|
|
}
|
|
|
|
modules[name] = component;
|
|
return true;
|
|
};
|