MinUk.Dev
Promise 정리 - minuk dev wiki

Promise 정리

created : Tue, 07 Apr 2020 20:22:09 +0900
modified : Tue, 15 Mar 2022 02:33:02 +0900

Synchronous vs Asynchronous

Callback hell

    CallEndpoint("api/getidbyusername/hotcakes", function(result) {
    	CallEndpoint("api/getfollowersbyid/" + result.userID, function(result) {
    		CallEndpoint("api/someothercall/" + result.followers, function(result) {
    			CallEndpoint("api/someothercall/" + result, function(result) {
    				// do something...
    			});
    		});
    	});
    });

Promise

Async, Await

References

The Great Escape from Callback Hell