-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
116 additions
and
48 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
Projects/Core/StreamListener/Interface/AnyStreamContinuation.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Foundation | ||
|
||
public class AnyStreamContinuation { | ||
private let _yield: (Any) -> Void | ||
|
||
public init<T>(_ continuation: AsyncStream<T>.Continuation) { | ||
self._yield = { value in | ||
guard let value = value as? T else { return } | ||
continuation.yield(value) | ||
} | ||
} | ||
|
||
public func yield(_ value: Any) { | ||
_yield(value) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Foundation | ||
|
||
// MARK: StreamType | ||
|
||
public protocol StreamTypeProtocol: Hashable { | ||
static var key: StreamType { get } | ||
} | ||
|
||
public enum StreamType: Hashable { | ||
case serverState | ||
case retry | ||
case toast | ||
} | ||
|
||
public enum ServerState: StreamTypeProtocol { | ||
public static var key: StreamType { .serverState } | ||
case requestStarted | ||
case requestCompleted | ||
case errorOccured | ||
case networkDisabled | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"10.52.3": "https://github.com/realm/realm-swift/releases/download/v10.52.3/Carthage.xcframework.zip" | ||
"10.54.1": "https://github.com/realm/realm-swift/releases/download/v10.54.1/Carthage.xcframework.zip" | ||
} |