Skip to content

Favor options object instead of arguments list in method signatures #40

@nerik

Description

@nerik

Instead of :

SQL.execute(sql [,vars][, options][, callback])

Use :

SQL.execute(sql, options);
SQL.execute(sql, {
   vars: vars
   callback: callback
})

Pros :

  • doesn't force the user to specify all args if they only need the last one
  • changes/adds to the API are a no brainer
  • easy set up of defaults in the beginning of the function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions