Created
January 17, 2018 18:19
-
-
Save jsatk/670438bc762f7960e3b3568e6f32c582 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const config = Object.freeze({ | |
async: true, | |
page: 4 | |
}); | |
const getThing = config => { | |
const awesomeFunction = options => { | |
const updatedOptions = Object.assign({}, options, { | |
offset: options.offset || 10 | |
}); | |
// do stuff with updatedOptions | |
}; | |
return Object.freeze({ | |
...config, | |
awesomeFunction, | |
amount: config.amount * 100 | |
}); | |
}; | |
const thing = getThing(config); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment