Skip to content

Commit

Permalink
refactor(plugin): cleanup plugin store
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-yudakov committed Oct 25, 2023
1 parent 203f88b commit db05fc1
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions packages/app/src/stores/PluginStore/PluginStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,16 @@ export const PluginStore = types
types.frozen<Record<string, PluginInfoInterface[]>>({}),
{}
),
// pluginsLoadersByIds: types.optional(types.frozen<Record<string, typeof PluginLoader>>({})), {}),
pluginsLoadersByIds: types.map(PluginLoader),
pluginLoadersByScopes: types.map(types.array(types.reference(PluginLoader))),

// pluginLoadersByScopes: types.optional(
// types.frozen<Record<string, typeof PluginLoader>>({}),
// {}
// ),

_plugins: types.optional(types.frozen<PluginInfoInterface[]>(), []),

pluginsRequest: types.optional(RequestModel, {}),
mediaUploader: types.optional(MediaUploader, {})
})
.actions((self) => ({
init: flow(function* () {
// init: function () {
const pluginsResponse = yield self.pluginsRequest.send(
api.pluginsRepository.getPluginsList,
{}
Expand Down Expand Up @@ -118,9 +111,6 @@ export const PluginStore = types
await pluginLoader.loadPlugin();

console.log('loaded plugin ', {plugin_id, meta, options});

// self.pluginsLoadersByIds.set(plugin_id, pluginLoader);

console.log('pluginLoader', pluginLoader);

return pluginLoader;
Expand All @@ -131,7 +121,6 @@ export const PluginStore = types
})
);
const loadedPlugins = plugins.filter((plugin: any) => !!plugin);
// self.pluginLoadersByScopes.set(scope, cast(loadedPlugins));
self.storePluginLoadersByScope(scope, loadedPlugins);

return loadedPlugins;
Expand Down

0 comments on commit db05fc1

Please sign in to comment.