Update /jobs

This commit is contained in:
Berkeley Martinez
2016-01-04 14:26:07 -08:00
parent ea574d721e
commit b62f09e71a
11 changed files with 258 additions and 241 deletions

13
common/utils/index.js Normal file
View File

@@ -0,0 +1,13 @@
export function nameSpacedTransformer(ns, transformer) {
if (!transformer) {
return nameSpacedTransformer.bind(null, ns);
}
return (state) => {
const newState = transformer(state[ns]);
// nothing has changed
if (newState === state[ns]) {
return state;
}
return { ...state, [ns]: newState };
};
}