Command processing (3/n): Uninstall plugin

Summary:
*Stack summary*: this stack refactors plugin management actions to perform them in a dispatcher rather than in the root reducer (store.tsx) as all of these actions has side effects. To do that, we store requested plugin management actions (install/update/uninstall, star/unstar) in a queue which is then handled by pluginManager dispatcher. This dispatcher then dispatches all required state updates.

*Diff summary*: refactored "uninstall plugin" operation to perform it in pluginManager dispatcher

Reviewed By: mweststrate

Differential Revision: D26166198

fbshipit-source-id: d74a1d690102d9036c6d3d8612d2428f5ecef4e6
This commit is contained in:
Anton Nikolaev
2021-02-16 10:46:11 -08:00
committed by Facebook GitHub Bot
parent 24aed8fd45
commit 01f02b2cab
19 changed files with 336 additions and 170 deletions

View File

@@ -102,7 +102,7 @@ export type State = {
settingsState: SettingsState & PersistPartial;
launcherSettingsState: LauncherSettingsState & PersistPartial;
supportForm: SupportFormState;
pluginManager: PluginManagerState & PersistPartial;
pluginManager: PluginManagerState;
healthchecks: HealthcheckState & PersistPartial;
usageTracking: TrackingState;
pluginDownloads: PluginDownloadsState;
@@ -159,20 +159,13 @@ export default combineReducers<State, Actions>({
{
key: 'plugins',
storage,
whitelist: ['marketplacePlugins'],
whitelist: ['marketplacePlugins', 'uninstalledPlugins'],
transforms: [setTransformer({whitelist: ['uninstalledPlugins']})],
},
plugins,
),
supportForm,
pluginManager: persistReducer<PluginManagerState, Actions>(
{
key: 'pluginManager',
storage,
whitelist: ['uninstalledPlugins'],
transforms: [setTransformer({whitelist: ['uninstalledPlugins']})],
},
pluginManager,
),
pluginManager,
user: persistReducer(
{
key: 'user',