This file contains hidden or 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 SwiftUI | |
// MARK: - API | |
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) | |
extension View { | |
public func foreground<Overlay: View>(_ overlay: Overlay) -> some View { | |
_Foreground(overlay: overlay, for: self) | |
} | |
} |
This file contains hidden or 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 SwiftUI | |
public struct ShadowConfiguration { | |
public var color: Color | |
public var radius: CGFloat | |
public var offset: CGPoint | |
public init(color: Color, radius: CGFloat, offset: CGPoint) { | |
self.color = color | |
self.radius = radius |
This file contains hidden or 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 | |
extension Bundle { | |
var id: String { bundleIdentifier ?? "" } | |
} | |
@propertyWrapper | |
public class Scheduled { | |
private static let defaultQueue = DispatchQueue( | |
label: Bundle.main.id.appending(".queues.scheduled"), |
This file contains hidden or 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 class CancellablesManager { | |
private let lock = NSLock() | |
public typealias Storage = Set<AnyCancellable> | |
private var cancellables: Storage = [] | |
func store(_ element: AnyCancellable?, _ precondition: Bool = true) { | |
lock.execute { | |
guard precondition, let element = element else { return } | |
cancellables.insert(element) |
This file contains hidden or 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 SwiftUI | |
public struct Component<Target, Coordinator, Body: View>: View { | |
private var makeBody: () -> Body | |
public var body: Body { makeBody() } | |
} | |
#if os(macOS) | |
public struct _ViewBody<Target: NSView, Coordinator>: NSViewRepresentable { | |
internal var _makeTarget: (Context) -> Target |
This file contains hidden or 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 Combine | |
typealias Reducer<State, Action> = (inout State, Action) -> Void | |
final class Store<State, Action>: ObservableObject { | |
typealias Effect = AnyPublisher<Action, Never> | |
@Published private(set) var state: State | |
private let lock: NSLock = .init() |
This file contains hidden or 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 | |
extension Sequence where Iterator.Element: Hashable { | |
public func unique() -> OrderedSet<Element> { .init(self) } | |
} | |
public struct OrderedSet<Element: Hashable>: BidirectionalCollection, Equatable, ExpressibleByArrayLiteral { | |
public typealias Index = Int | |
private var set: Set<Element> = [] |
This file contains hidden or 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 Fluent | |
private struct _Migration<T>: Migration { | |
var preparation: (Database) -> EventLoopFuture<Void> | |
var revertion: (Database) -> EventLoopFuture<Void> | |
func prepare(on database: Database) -> EventLoopFuture<Void> { preparation(database) } | |
func revert(on database: Database) -> EventLoopFuture<Void> { revertion(database) } | |
} | |
public protocol MigrationProvider { |
This file contains hidden or 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 SwiftUI | |
extension Color { | |
public init(light: Color, dark: Color) { | |
self = valueForTheme(light: light, dark: dark) | |
} | |
} |