Hi Scott, Essentially I would like to use Promises in the same way as used by jQuery 1.5 (or at least how their AJAX API uses it) but I just don't have the first clue on how to implement it in actual JavaScript code?
I understand that there are different implementations of Promises and looking through them it seems that jQuery's was based on Promises/A API so I guess that is the one I'd most likely want to try and implement. Again, I just don't understand how to implement it. I've found a few very basic variations... https://gist.github.com/814313 https://gist.github.com/814318 ...but I'm not sure how you would go about using these as examples? Regards, Mark -- Mark McDonnell On Tuesday, 29 March 2011 at 14:07, Scott Sauyet wrote: > Mark McDonnell wrote: > > To clarify I would like to see an example of how to actually > > write a implementation of Promises into my own library. > > > > I understand the principle of how they work from using them > > in jQuery but I'm writing my own small utility library and > > would like to learn how to add Promises to my library. > > > > Hope that helps explain what I'm trying to achieve. > > I'm afraid that it really doesn't explain what you want. > > The various Promises proposals have differing APIs and, of course, > different implementations. > > You need to decide first of all what you want to use Promises for, and > then at least sketch out an API. If you're looking for critiques of > your API choices, let us know; there are probably people around > willing to help. If you're satisfied with your API and are having > trouble implementing it, feel free to post those issues here. There > are a lot of smart people who might be willing to help. > > But as it stands, "How do I implement Promises?" is just too vague. > > -- Scott > > -- > To view archived discussions from the original JSMentors Mailman list: > http://www.mail-archive.com/[email protected]/ > > To search via a non-Google archive, visit here: > http://www.mail-archive.com/[email protected]/ > > To unsubscribe from this group, send email to > [email protected] > -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
