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:
committed by
Facebook Github Bot
parent
27c0a03ac2
commit
07e5d7faf7
@@ -39,7 +39,7 @@ export default function reducer(
|
|||||||
): State {
|
): State {
|
||||||
if (action.type === 'SET_PLUGIN_STATE') {
|
if (action.type === 'SET_PLUGIN_STATE') {
|
||||||
const newPluginState = action.payload.state;
|
const newPluginState = action.payload.state;
|
||||||
if (newPluginState && newPluginState !== state) {
|
if (newPluginState && newPluginState !== state[action.payload.pluginKey]) {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
[action.payload.pluginKey]: {
|
[action.payload.pluginKey]: {
|
||||||
|
|||||||
Reference in New Issue
Block a user