Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. iOS
  3. When

When

NOASSERTIONSwift5.0.0

A lightweight, type-safe Promise implementation for Swift, designed for flexibility and clean asynchronous code.

Visit WebsiteGitHubGitHub
263 stars34 forks0 contributors

What is When?

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.

Target Audience

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.

Value Proposition

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.

Overview

:alarm_clock: A lightweight implementation of Promises in Swift

Use Cases

Best For

  • Simplifying complex asynchronous operations in Swift apps
  • Replacing nested callbacks with clean promise chains
  • Handling multiple concurrent async tasks with coordination
  • Integrating promises into libraries without platform lock-in
  • Building type-safe async workflows with error recovery
  • Combining promises with RxSwift via provided extensions

Not Ideal For

  • Projects needing built-in iOS/macOS async helpers for UI updates or network wrappers
  • Teams requiring extensive promise utilities like automatic retries, timeouts, or progress tracking
  • Developers already using Swift's native async/await features and prefer to avoid promise patterns

Pros & Cons

Pros

Type-Safe Generics

Uses Swift generics to enforce type safety across promise chains, ensuring compile-time checks for data types and reducing runtime errors.

Clean Chaining API

Supports then, done, fail, always, and recover methods for readable asynchronous workflows, as demonstrated in the README's code examples.

Error Recovery

Includes a recover method to handle errors and continue promise chains, improving resilience in async operations without breaking the flow.

Concurrent Coordination

Provides a when function to manage multiple promises concurrently, resolving only when all complete or failing on first rejection.

Cons

No Platform-Specific Helpers

Intentionally omits iOS/macOS integrations, forcing developers to write custom wrappers for common tasks like network requests or UI updates.

Limited Advanced Features

Lacks built-in support for timeouts, retries, and progress tracking, which are often standard in more comprehensive promise libraries.

Smaller Ecosystem

Has a smaller community compared to alternatives like PromiseKit, resulting in fewer third-party extensions, tutorials, and community support.

Frequently Asked Questions

Quick Stats

Stars263
Forks34
Contributors0
Open Issues2
Last commit6 years ago
CreatedSince 2016

Tags

#ios#async-await#reactive-programming#lightweight#promises#type-safe#concurrency#swift#promise#macos

Built With

S
Swift

Links & Resources

Website

Included in

iOS51.7kSwift26.0k
Auto-fetched 1 day ago

Related Projects

RxSwiftRxSwift

Reactive Programming in Swift

Stars24,627
Forks4,149
Last commit1 month ago
ReactiveCocoaReactiveCocoa

Cocoa framework and Obj-C dynamism bindings for ReactiveSwift.

Stars19,789
Forks3,408
Last commit1 year ago
PromiseKitPromiseKit

Promises for Swift & ObjC.

Stars14,210
Forks1,459
Last commit4 months ago
ReSwiftReSwift

Unidirectional Data Flow in Swift - Inspired by Redux

Stars7,581
Forks515
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub