Skip to content

Simple promises in Swift, inspired by KSPromise

License

Notifications You must be signed in to change notification settings

mjstallard/CBGPromise

 
 

Repository files navigation

CBGPromise

CI Status Version License Platform

Installation

CBGPromise is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "CBGPromise"

Usage

import CBGPromise

class Test {
    func getToken() -> Future<String> {
        let promise = Promise<String>()

        doAsyncCall {
            promise.resolve("Test")
        }

        return promise.future
    }

    func printToken() {
        getToken().then { token in
            print(token)
        }
    }
}

Author

Can Berk Güder

License

CBGPromise is available under the MIT license. See the LICENSE file for more info.

About

Simple promises in Swift, inspired by KSPromise

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 89.2%
  • Ruby 8.4%
  • Objective-C 2.4%