mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-04-30 23:08:10 +02:00
4647310322
Based on Swiftgram 12.5 (Telegram iOS 12.5). All GLEGram features ported and organized in GLEGram/ folder. Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass, Font Replacement, Fake Profile, Chat Export, Plugin System, and more. See CHANGELOG_12.5.md for full details.
33 lines
802 B
Swift
33 lines
802 B
Swift
import Foundation
|
|
|
|
public func single<T, E>(_ value: T, _ errorType: E.Type) -> Signal<T, E> {
|
|
return Signal<T, E> { subscriber in
|
|
subscriber.putNext(value)
|
|
subscriber.putCompletion()
|
|
|
|
return EmptyDisposable
|
|
}
|
|
}
|
|
|
|
public func fail<T, E>(_ valueType: T.Type, _ error: E) -> Signal<T, E> {
|
|
return Signal<T, E> { subscriber in
|
|
subscriber.putError(error)
|
|
|
|
return EmptyDisposable
|
|
}
|
|
}
|
|
|
|
public func complete<T, E>(_ valueType: T.Type, _ error: E.Type) -> Signal<T, E> {
|
|
return Signal<T, E> { subscriber in
|
|
subscriber.putCompletion()
|
|
|
|
return EmptyDisposable
|
|
}
|
|
}
|
|
|
|
public func never<T, E>(_ valueType: T.Type, _ error: E.Type) -> Signal<T, E> {
|
|
return Signal { _ in
|
|
return EmptyDisposable
|
|
}
|
|
}
|