Description
openedon Dec 1, 2022
This continues a discussion from #102 regarding the argument order of adopt()
, the outcome of which is a condition for Stage 3 advancement.
As I understand it, it is @ljharb's position that the argument order should be adopt(onDispose [, value])
, which would potentially make defer(onDispose)
unnecessary due to overlap. The precedent for this would be the existence of the optional thisArg
in existing APIs like Array.prototype.map
, .filter
, .forEach
, and the optional initialValue
argument to Array.prototype.reduce
and .reduceRight
.
It is the champion's position that adopt(value, onDispose)
is the correct argument order, with the precedent being existing APIs such as JSON.parse
, JSON.stringify
, and Array.from
, and that there are inherent differences in how .adopt
is intended to be used vs. .defer
that indicate these should be separate methods.
Rather than go into more detail for each argument in the issue description, I'll post specifics related to my rationale in the comments below.
@ljharb: If you have any further details you'd like to provide, please let me know in the comments as well. If I have misrepresented your position in any way, let me know and I can update the issue description to more accurately summarize your position.