onceAsync
As https://github.com/js-choi/proposal-function-once/issues/2#issuecomment-1081942617 says, the plenary today was slightly in favor of once functions returning undefined every time (and ignoring arguments), so that all function calls remain idempotent. Any sync error thrown by the first call would only be thrown by the first call once and no more times after that. If the return value is needed, the developer would have to use a memoize function instead (which I also plan to propose).
However, returning undefined means that the promises returned by async functions are lost—which also means that rejections cannot be detected.
Should we have a onceAsync function? Is it within scope of this proposal?
If const f = onceAsync(Promise.resolve); then [f(0), f(1), f(2)] could return [p, p, p], where p is the same promise that resolves to undefined, and arguments are ignored.
(Spun off from #7.)
In case of returning a cached value, this issue disappears by itself.