Movatterモバイル変換


[0]ホーム

URL:


Friday,December31,2021

Lightweight Dependency Injection Using Async Functions

John Sundell:

What if we could actually make our code fully testable in a way that doesn’t require us to introduce any new protocols, mocking types, or complicated abstractions? Let’s explore how we could make use of Swift’s newasync/await capabilities to make that happen.

[…]

One thing that’s very neat about the above pattern is that it still lets us keep using our existingNetworking andProductLoader code just like before — all that we have to do is to call that code within thereloading function/closure that we pass into ourProductViewModel when creating it[…]

Previously:

CommentsRSS ·Twitter

Leave a Comment

  

Black Friday
Blog
Archives
Tag Cloud
Top Posts

Recently Updated
RSS Feed ·Comments
Mastodon ·Twitter
Apple News
Trackback

Support this site viaPatreon.

Try my Mac apps:

DropDMGDropDMGDropDMG
EagleFilerEagleFilerEagleFiler
SpamSieveSpamSieveSpamSieve
ToothFairyToothFairyToothFairy
Copyright © 2000–2025Michael Tsai.

[8]ページ先頭

©2009-2025 Movatter.jp