Skip to content

Instantly share code, notes, and snippets.

@sergueyarellano
Created May 28, 2021 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergueyarellano/3cb58f488a66d43a5db3a53b521b9b17 to your computer and use it in GitHub Desktop.
Save sergueyarellano/3cb58f488a66d43a5db3a53b521b9b17 to your computer and use it in GitHub Desktop.
function doSomething (payload) {
const newPayload = cloneDeep(payload) // cloning to avoid mutations on source
const result = composeResult(newPayload) // doing something
// set the result in a path
return set(newPayload, 'my.path', result)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment