Can I use other promise implementations in the Parse JavaScript SDK?

后端 未结 3 1634
暖寄归人
暖寄归人 2021-01-02 01:54

I am concerned about references I have seen to Parse using JQuery-compatible promises, as I have read that jQuery promises allow consumers to mutate the state of the promise

3条回答
  •  悲&欢浪女
    2021-01-02 02:39

    You can use native Promises, or a good polyfill. You can encapsulate any thenable (a Promise-like object with a public then method) in Promise.resolve call, like this:

    var promise = Promise.resolve($.getJSON("/something.json"));
    

    This will also have a then method, but without any headaches. It should still work.

提交回复
热议问题