and populate each existing call site with the extracted value (in this example "b")
Use Cases
It is a common refactoring when you discover that a previously fixed value should instead be provided by a caller
Examples
e.g. in the case where I went looking for it code in a Lambda function that created a fixed header had to start providing a varying value depending on context and the easiest refactoring was to extract the currently fixed value as a parameter so that the callers that would vary it could do without breaking other callers
Search Terms
Suggestion
Add a refactoring to extract to parameter for JS/TS
e.g.
for
the extract to parameter refactoring would change to
and populate each existing call site with the extracted value (in this example "b")
Use Cases
It is a common refactoring when you discover that a previously fixed value should instead be provided by a caller
Examples
e.g. in the case where I went looking for it code in a Lambda function that created a fixed header had to start providing a varying value depending on context and the easiest refactoring was to extract the currently fixed value as a parameter so that the callers that would vary it could do without breaking other callers
see https://twitter.com/mattbierner/status/1234920525543002113
Checklist
My suggestion meets these guidelines: