Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ddddxxx committed Jun 22, 2020
1 parent 27f2f01 commit d6d0660
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Sources/CXExtensions/AnyScheduler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ private enum SchedulerTimeLiteral {
}
}

/// A type-erasing scheduler.
///
/// Do not use `SchedulerTimeType` across different `AnyScheduler` instance.
///
/// let scheduler1 = AnyScheduler(DispatchQueue.main.cx)
/// let scheduler2 = AnyScheduler(RunLoop.main.cx)
///
/// let time1 = scheduler1.now
/// let time2 = scheduler2.now
///
/// // DON'T DO THIS!
/// time1.distance(to: time2) // Will crash.
///
public final class AnyScheduler: Scheduler {

public typealias SchedulerOptions = Never
Expand Down

0 comments on commit d6d0660

Please sign in to comment.