Skip to content

Instantly share code, notes, and snippets.

@jsatk
Last active January 17, 2018 01:07
Show Gist options
  • Save jsatk/bd6730a9559268db7f6db410c8a24db8 to your computer and use it in GitHub Desktop.
Save jsatk/bd6730a9559268db7f6db410c8a24db8 to your computer and use it in GitHub Desktop.
const options = Object.freeze({
async: true,
page: 4
});
const awesomeFunction = options => {
const updatedOptions = Object.assign({}, options, {
offset: options.offset || 10
});
// do stuff with updatedOptions
};
awesomeFunction(options);
someOtherFunction(options);
yetAnotherFunction(options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment