Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/meniny/oath
- Owner: Meniny
- License: mit
- Created: 2018-03-06T07:17:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-16T04:48:51.000Z (over 5 years ago)
- Last Synced: 2024-09-18T12:05:04.859Z (about 2 months ago)
- Topics: future, oath, promise
- Language: Swift
- Size: 64.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## 🏵 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") }
}
}
```