Download
(6 Kb)
Download
Updated: 06/15/22 02:27 PM
Pictures
File Info
Compatibility:
High Isle (8.0.0)
Updated:06/15/22 02:27 PM
Created:02/26/19 09:32 AM
Monthly downloads:7,407
Total downloads:631,547
Favorites:425
MD5:
LibPromises  Popular! (More than 5000 hits)
Version: 1.1.1
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.
v1.1.1
- fixed incorrect detection of callable tables
- improved unhandled promise rejection logging to only log after the current context has ended

v1.1.0
- added logging of unhandled promise rejections when LibDebugLogger is available
- updated API version for High Isle

v1.0.3
- added IsLibrary flag to manifest
- updated API version for Elsweyr
Archived Files (3)
File Name
Version
Size
Uploader
Date
1.1.0
6kB
sirinsidiator
06/10/22 01:09 PM
1.0.3
5kB
sirinsidiator
05/21/19 02:49 PM
1.0.2
5kB
sirinsidiator
02/26/19 09:32 AM


Post A Reply Comment Options
Unread 04/08/20, 04:55 PM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1566
File comments: 1117
Uploads: 41
Re: Newer version

Originally Posted by GoddessFreya
Is there a newer version than 1.0.2 of this addon?
1.0.3 is the current version, which you can readily see when you take a look at the AddOn Info tab or the Change Log tab.
Report comment to moderator  
Reply With Quote
Unread 04/08/20, 03:11 PM  
GoddessFreya

Forum posts: 0
File comments: 3
Uploads: 0
Newer version

Is there a newer version than 1.0.2 of this addon?
Report comment to moderator  
Reply With Quote
Post A Reply



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.