Classes

The following classes are available globally.

  • An object that represents the eventual completion or failure of an asynchronous operation, and its resulting value.

    See more

    Declaration

    Swift

    public class PromiseLite<Value>
  • A default implementation of PromiseLiteDebugger.

    To enable logging promises just set PromiseLiteConfig.debugger variable, like PromiseLiteConfig.debugger = DefaultPromiseLiteDebugger { print($0) }.

    Example

    Given the following chaining:

    Promise.resolve(3)
      .map { _ in throw FooError.πŸ’₯ }
      .map { _ in "foo" }
      .catch { _ in return "goo" }
      .map { $0 }
    

    Logs using print the follwing outputs:

    πŸ”— | PromiseLite<Int> resolves βœ… in 0.00 sec
    πŸ”— | PromiseLite<()> rejects ❌ in 0.00 sec with error: πŸ’₯
    πŸ”— | PromiseLite<String> rejects ❌ in 0.00 sec with error: πŸ’₯
    πŸ”— | PromiseLite<String> resolves βœ… in 0.00 sec
    πŸ”— | PromiseLite<String> resolves βœ… in 0.00 sec
    
    See more

    Declaration

    Swift

    public final class DefaultPromiseLiteDebugger : PromiseLiteDebugger