Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I know what a javascript Promise is, but is there a name for "a function that returns a Promise"?

I'm writing a function that returns "a function that returns a promise," and I'm struggling to name and document my function.

Is there a name for "a function that returns a Promise"?

Note: "No" is an acceptable answer.

like image 386
Tylor Hess Avatar asked Nov 22 '25 13:11

Tylor Hess


1 Answers

Basically, no. There is not a canonical name for a function that returns a Promise. You can call it whatever you like so long as it is true to the idea that a Promise captures some asynchronous functionality. For example, "an asynchronous function".

However, I would suggest simply using "function that returns a Promise". This is most accurate when you consider that the function itself is not any different for its return value (as @DaveNewton said, the fact it returns a Promise is an implementation detail).

like image 97
sdgluck Avatar answered Nov 24 '25 02:11

sdgluck



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!