mirror of
https://github.com/ReactiveX/RxSwift.git
synced 2024-10-05 06:27:29 +03:00
Add Recorded Event timeless factory method
This commit is contained in:
parent
0bc7754ea7
commit
b924b28ac4
@ -9,6 +9,21 @@
|
||||
import RxTest
|
||||
import RxSwift
|
||||
|
||||
extension Recorded {
|
||||
|
||||
public static func next<T>(_ element: T) -> Recorded<Event<T>> where Value == Event<T> {
|
||||
return Recorded(time: 0, value: .next(element))
|
||||
}
|
||||
|
||||
public static func completed<T>(_ type: T.Type = T.self) -> Recorded<Event<T>> where Value == Event<T> {
|
||||
return Recorded(time: 0, value: .completed)
|
||||
}
|
||||
|
||||
public static func error<T>(_ error: Swift.Error, _ type: T.Type = T.self) -> Recorded<Event<T>> where Value == Event<T> {
|
||||
return Recorded(time: 0, value: .error(error))
|
||||
}
|
||||
}
|
||||
|
||||
func next<T>(_ value: T) -> Recorded<Event<T>> {
|
||||
return Recorded(time: 0, value: .next(value))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user