Quantcast
Download
(5 Kb)
Download
Updated: 02/26/19 09:32 AM
Pictures
File Info
Compatibility:
Wrathstone (4.3)
Updated:02/26/19 09:32 AM
Created:02/26/19 09:32 AM
Monthly downloads:678
Total downloads:1,487
Favorites:3
MD5:
4.3
LibPromises
Version: 1.0.2
by: sirinsidiator [More]
A library for Elder Scrolls Online which implements the Promises/A+ specification.

Source can be found on github.

Usage:
Add LibPromises to your addon's dependencies.
Then you can use it like in the following example:
Lua Code:
  1. local Promise = LibPromises
  2.  
  3. local function MyFunction()
  4.     local promise = Promise:New()
  5.     if(math.random() > 0.5) then
  6.         promise:Resolve("hello world")
  7.     else
  8.         promise:Reject("no luck today")
  9.     end
  10.     return promise
  11. end
  12.  
  13. local function MyOtherFunction(message)
  14.     d(message)
  15. end
  16.  
  17. local function MyErrorHandler(message)
  18.     d(message)
  19. end
  20.  
  21. MyFunction():Then(MyOtherFunction, MyErrorHandler)

For more complex examples, check out the activity classes in AwesomeGuildStore or search the web. It follows the spec, so it should be able to do what other language implementations do too.
There have been no comments posted to this file.
Be the first to add one.



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.