π Reference
π Chapter
Promise.all()
Promise.race()
Promise.prototype.finally()
Promise.prototype.catch()
Promise.prototype.then()
async & await
Callback function
Promise
- Promise
- μλ°μ€ν¬λ¦½νΈ λΉλκΈ° μ²λ¦¬μ μ¬μ©λλ κ°μ²΄μ΄λ€.
- μ¬κΈ°μ μλ°μ€ν¬λ¦½νΈμ λΉλκΈ° μ²λ¦¬λ βνΉμ μ½λμ μ€νμ΄ μλ£λ λκΉμ§ κΈ°λ€λ¦¬μ§ μκ³ λ€μ μ½λλ₯Ό λ¨Όμ μννλ μλ°μ€ν¬λ¦½νΈμ νΉμ±βμ μλ―Ένλ€.
- λΉλκΈ°λ₯Ό κ°νΈνκ² μ²λ¦¬ν΄μ£Όλ objectμ΄λ€.
- ν΅μ¬ κ°λ
: state, producer, consumers
- state: pending β fulfilled or rejected
Producer
promise
κ° λ§λ€μ΄μ§λ μκ° μμ ν¨μκ° λ°λ‘ μ€νλλ€.
executor
(μμνν°)λΌλ ν¨μλ₯Ό μ λ¬ν΄μ€μΌνλ€.
- μ΄
executor
(μμνν°)λ resolve
μ reject
μ μΈμλ₯Ό λ°λλ€.
