1.1.0 • Published 9 months ago

@sanjo-addons/resolvable v1.1.0

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

Resolvable

A library for working with resolvables. Resolvables are similar to promises or futures. This library can save add-on developers some work.

Things included

  • Resolvable.Resolvable: a class for a resolvable.
    • Resolvable.Resolvable:new: a constructor for creating a resolvable.
    • Resolvable.Resolvable:afterResolve / Resolvable.Resolvable.after: a method for registering a callback which is called after the resolvable is resolved.
    • await / Resolvable.await: a function for awaiting on a promise. Can only be used in a coroutine.
    • Resolvable.all: a function for creating a new resolvable which resolves when all resolvables, that have been passed, have been resolved.

"Resolvable.Resolvable:new" returns a second return value, which is a table with internal methods which can be used by the creator of the resolvable. Those include:

  • resolve: a method to resolve the resolvable.