RepositorySwift
FR

freshOS/Then

:clapper: Tame async code with battle-tested promises

990sao
79fork
5issue
2lượt xem

🚀 Then - Bắt tay dấu promise cho async Swift, code đọc như tiếng Anh

Async code dễ viết, dễ đọc, dễ bảo trì với Then - micro-framework Promise & Async/Await từ freshOS.

Async code khó viết, khó đọc, khó bảo trì. Then sinh ra để giải phóp: dùng then viết chuỗi async đọc như câu, kết hợp Promise/Future + Async/Await + helper mạnh.

✨ Điểm nổi bật

  • Promise & Async/Await: Hỗ trợ cả hai mô hình lập trình bất đồng bộ.
  • Helper đa dạng: race, recover, retry, validate, chain, whenAll, noMatterWhat, unwrap...
  • Strongly typed: Kiểu an toàn tại thời điểm biên dịch.
  • Progress & error handling: progress, onError, finally, bridgeError.
  • Swift thuần & nhẹ: Pure Swift, không dependency.
  • registerThen: Đăng ký block mà không khởi chạy promise.
  • SPM compatible: Cài đặt dễ dàng qua Swift Package Manager.
  • Multi-platform: iOS, macOS, tvOS, watchOS.

💡 Vì sao đáng chú ý

Then khác phách thức: thay vì callback lồng nhau (callback hell), dùng then tạo pipeline async ngắn gọn. registerThen cho phép lazy execution. Helper như retry, race xử lý edge case. Đọc code như câu chữ, giảm thiểu lỗi.


#Promise #Swift #AsyncAwait #iOS #MicroFramework #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryC++
YACLib/YACLib

Yet Another Concurrency Library

300
Aug 31, 2026
Repository
getify/You-Dont-Know-JS

A book series (2 published editions) on the JS language.

184.8k
Oct 31, 2026
RepositorySwift
permissionlesstech/bitchat

bluetooth mesh chat, IRC vibes

37.2k
Nov 27, 2026
RepositorySwift
airbnb/lottie-ios

An iOS library to natively render After Effects vector animations

27.0k
Nov 24, 2026
RepositorySwift
ReactiveX/RxSwift

Reactive Programming in Swift

24.6k
Nov 13, 2026
RepositorySwift
onevcat/Kingfisher

A lightweight, pure-Swift library for downloading and caching images from the web.

24.4k
Nov 28, 2026
RepositorySwift
CodeEditApp/CodeEdit

📝 CodeEdit App for macOS – Elevate your code editing experience. Open source, free forever.

23.1k
Oct 17, 2026
RepositorySwift
HeroTransitions/Hero

Elegant transition library for iOS & tvOS

22.5k
Jan 23, 2025
Repository
dkhamsing/open-source-ios-apps

:iphone: Collaborative List of Open-Source iOS Apps

53.6k
Nov 30, 2026