Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/meniny/oath

Promise / Future concept for Swift developing.
https://github.com/meniny/oath

future oath promise

Last synced: about 1 month ago
JSON representation

Promise / Future concept for Swift developing.

Awesome Lists containing this project

README

        





Version
Author
Build Passing
Swift


Platforms
MIT


Cocoapods
Carthage
SPM

## 🏵 Introduction

**Oath** is a `Promise` / `Future` concept implementation for Swift developing.

Learn [more](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) about `Promise`.

## 📋 Requirements

- iOS 8.0+
- macOS 10.10+
- tvOS 9.0+
- Xcode 9.0+ with Swift 5.0+

## 📲 Installation

`Oath` is available on [CocoaPods](https://cocoapods.org):

```ruby
use_frameworks!
pod 'Oath'
```

## ❤️ Contribution

You are welcome to fork and submit pull requests.

## 🔖 License

`Oath` is open-sourced software, licensed under the `MIT` license.

## 💫 Usage

```swift
fetchUserInfo().then { info in
print("User: \(info)")
}.onError { e in
print("An error occured : \(e)")
}.finally {
print("Everything is done <3")
}
```

```swift
func fetchUserInfo() -> Promise {
return Promise { resolve, reject in
print("fetching user info...")
wait { resolve("Elias") }
}
}
```