Hand tear promise source code and its principle

preface Ha ha, I haven't written a blog for a long time, mainly because I just joined Netease these days and have been adapting to work and all kinds of messy things in school, so I haven't had time to write. I just finished an iteration today. It's rare to have free time to write a blog (actually fishing ~). Before, I also wrote a hand tearin ...

Posted on Thu, 11 Nov 2021 18:01:44 -0500 by ParkerPHP

Promise a + handwritten promise

@[TOC] (article directory) preface 1. Promise's meaning? In the world of JavaScript, all code is executed by single thread. Due to this "defect", all network operations and browser events of JavaScript must be executed asynchronously. Ajax can solve this problem, but it is not easy to reuse. The chain call of JQuery can also b ...

Posted on Thu, 04 Nov 2021 05:14:20 -0400 by chancho

Handwritten wheel series - handwritten promise (smooth as silk)

Handwritten wheel series - handwritten promise (smooth as silk) Promise is a solution for JS asynchronous programming, which is more reasonable and powerful than the traditional solutions - callback functions and events. Promise is simply a container that holds the results of an event (usually an asynchronous operation) that will not end ...

Posted on Mon, 18 Oct 2021 17:34:14 -0400 by kostasls

ES6-Promise and Source Implementation

Beginning InstructionsProperty value of promise instantiated object [promiseState]Property value of promise instantiated object [promiseResult]API for promise Promise's constructor [Promise(executor){}]Promise.prototype.then method [(onResolved, onRejected){}]Promise.prototype.catch method [(onRejected){}]The Promise.resolve method belongs t ...

Posted on Sun, 12 Sep 2021 14:39:49 -0400 by Rustywolf