Update /jobs
This commit is contained in:
13
common/utils/index.js
Normal file
13
common/utils/index.js
Normal 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 };
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user