Skip to content

Instantly share code, notes, and snippets.

@schmidtfx
Last active January 25, 2021 10:54
Show Gist options
  • Save schmidtfx/f60cb058a01562ee80294f711c9b8435 to your computer and use it in GitHub Desktop.
Save schmidtfx/f60cb058a01562ee80294f711c9b8435 to your computer and use it in GitHub Desktop.
// Let's define an original function
const my_func = (param1, param2) => {
};
const result = my_func(1, 2);
// Ohh, I want to update my orginal function with additional fields, but won't break backwards compatibility
const my_func = (param1, param2, {onClick} = {}) => {
}
const result = (1, 2, {
onClick: (ev) => { }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment