jQuery deferreds and promises - .then() vs .done()

后端 未结 10 1589
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 06:16

I\'ve been reading about jQuery deferreds and promises and I can\'t see the difference between using .then() & .done() for successful callbacks

10条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-22 07:06

    There is a very simple mental mapping in response that was a bit hard to find in the other answers:

    • done implements tap as in bluebird Promises

    • then implements then as in ES6 Promises

提交回复
热议问题