~ knotless Search/
↑↓ move↵ open⇧↵ all results

geesawra.industries/old-fella

Old people's social media app

0
1
main
20 lines · 395 B Raw History
import Observation
import XCTest

@testable import OldFella

final class FeedCallCounter: @unchecked Sendable {
    private let lock = NSLock()
    private var calls = 0
    func next() -> Int {
        lock.lock()
        defer { lock.unlock() }
        calls += 1
        return calls
    }
    var count: Int {
        lock.lock()
        defer { lock.unlock() }
        return calls
    }
}