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
public protocol RetryStrategy { | |
/// True if the strategy allows to retry a failed action. False if all the retries have been 'used up'. | |
var shouldRetry: Bool { get } | |
/// The delay for which to wait before attempting to retry a failed action. | |
var delay: TimeInterval { get } | |
/// Returns a copy of this retry strategy with the number of allowable retries lowered by one. | |
var consumedOnce: Self { get } | |
} |
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
import Foundation | |
import Combine | |
public enum WebSocketError: Swift.Error { | |
case alreadyConnectedOrConnecting | |
case notConnected | |
case cannotParseMessage(String) | |
} | |
public extension WebSocket { |
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
import useThemedStyles, { createThemedStyleSheet } from "./useThemedStyles" | |
export default function Component() { | |
const [styles, colorScheme] = useThemedStyles(stylesheet) | |
// ... | |
} | |
const stylesheet = createThemedStyleSheet((theme) => ({ | |
container: { | |
backgroundColor: theme.colors.background |
OlderNewer