Skip to content

Instantly share code, notes, and snippets.

@iandesj
Created July 16, 2019 14:45
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 iandesj/c92574ca78b916c76cefc937c628bea9 to your computer and use it in GitHub Desktop.
Save iandesj/c92574ca78b916c76cefc937c628bea9 to your computer and use it in GitHub Desktop.
Configuration Objects vs. Many Parameters
// before - 5 args too many
function initializeNewUserWorflow(
email, password, location,
organization, referred) {
// initialize the new user
}
// after - using configuration object
const initializeUserConfiguration = {
email: 'email',
password: 'password',
location: 'location',
organization: 'kla',
referred: true,
};
function initializeNewUserWorkflow(initializeUserConfiguration) {
// do the thang
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment