Promise 정리

created : 2020-04-07T11:22:09+00:00
modified : 2022-03-14T17:33:02+00:00

js promise

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