Don't subscribe to entire store. Don't cause rerender on every store change

Reviewed By: passy

Differential Revision: D19968715

fbshipit-source-id: 74e5ca9d2f68c6fa4e04771e7ad7ba1fecb207f3
This commit is contained in:
Michel Weststrate
2020-02-19 22:15:25 -08:00
committed by Facebook Github Bot
parent 27c0a03ac2
commit 07e5d7faf7

View File

@@ -39,7 +39,7 @@ export default function reducer(
): State {
if (action.type === 'SET_PLUGIN_STATE') {
const newPluginState = action.payload.state;
if (newPluginState && newPluginState !== state) {
if (newPluginState && newPluginState !== state[action.payload.pluginKey]) {
return {
...state,
[action.payload.pluginKey]: {