Skip to content

Smarter function-passed-to-function heuristics? #1

Open
@nolanlawson

Description

@nolanlawson

Good candidates for wrapping:

  • forEach(function() {})
  • map(function() {})
  • then(function() {})
  • UMD/Browserify/Webpack definitions

Less-good candidates:

  • addEventListener('foo', function() {})
  • on('foo', function() {})
  • once('foo', function() {})
  • catch('foo', function() {}) (maybe?)

We can check for the function name as a hint to avoid the paren-wrapping, but it ought to be justified by a benchmark. Maybe a UI library that adds a lot of event listeners would be a good test case for this.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions