Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

the feature of method Promise.prototype.chain in chrome [closed]

a method in chrome browser named Promise.prototype.chain. I cannot find any documentation about this method. Anybody know anything about it?

btw can i find the documentations of google chrome for all methods in the browser?

like image 798
LCB Avatar asked Oct 19 '22 18:10

LCB


1 Answers

Note: Now .chain is just a deprecated alias for then.


What chain does is basically what then does except not unwrapping promises. Chain is a proper "monadic flatMap" rather than then which automatically unwraps promises.

It was discussed at great lengths on the mailing list and in TC meetings. It was decided against.

.chain is just a relic of the past in Chrome, it might make it in a future release but currently no one is championing a proposal including it. I would not use it in production.

like image 61
Benjamin Gruenbaum Avatar answered Nov 04 '22 18:11

Benjamin Gruenbaum