From cbde6b646e566f9d5f8ab920eb3c690783586369 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Tue, 5 Jan 2016 12:05:01 -0800 Subject: [PATCH] Fix for name-spaced transformer --- common/utils/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/utils/index.js b/common/utils/index.js index 0456c3bbbe4..85f49c563f9 100644 --- a/common/utils/index.js +++ b/common/utils/index.js @@ -4,10 +4,13 @@ export function nameSpacedTransformer(ns, transformer) { } return (state) => { const newState = transformer(state[ns]); + // nothing has changed - if (newState === state[ns]) { - return state; + // noop + if (!newState || newState === state[ns]) { + return null; } + return { ...state, [ns]: newState }; }; }