A lightweight, type-safe Promise implementation for Swift, designed for flexibility and clean asynchronous code.
When is a lightweight Promise library for Swift that simplifies asynchronous programming by providing a standardized way to handle future values. It solves the problem of callback hell by enabling clean, chainable async operations with type safety and error handling. The library is intentionally minimal, avoiding iOS/macOS-specific helpers to maintain flexibility.
Swift developers building iOS, macOS, or server-side applications who need a simple, type-safe way to manage asynchronous tasks without the overhead of larger promise libraries.
Developers choose When for its minimal design, full type safety via Swift generics, and focus on core promise functionality without unnecessary dependencies. It offers greater control over async workflows compared to heavier alternatives.
:alarm_clock: A lightweight implementation of Promises in Swift
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Swift generics to enforce type safety across promise chains, ensuring compile-time checks for data types and reducing runtime errors.
Supports then, done, fail, always, and recover methods for readable asynchronous workflows, as demonstrated in the README's code examples.
Includes a recover method to handle errors and continue promise chains, improving resilience in async operations without breaking the flow.
Provides a when function to manage multiple promises concurrently, resolving only when all complete or failing on first rejection.
Intentionally omits iOS/macOS integrations, forcing developers to write custom wrappers for common tasks like network requests or UI updates.
Lacks built-in support for timeouts, retries, and progress tracking, which are often standard in more comprehensive promise libraries.
Has a smaller community compared to alternatives like PromiseKit, resulting in fewer third-party extensions, tutorials, and community support.