Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
abstract class BeforeSuiteExtension : BeforeAllCallback, ExtensionContext.Store.CloseableResource { | |
companion object { | |
@JvmStatic | |
private val lock = ReentrantLock() | |
@JvmStatic | |
private var isStarted: Boolean = false | |
} |
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
func combineLatest<A, B, R>(_ aSequence: A, _ bSequence: B, transform: @escaping (A.Element, B.Element) -> R) -> AsyncStream<R> where A : AsyncSequence, B : AsyncSequence { | |
return AsyncStream { (continuation) async in | |
let aCurrentValue = Ref<A.Element?>(initialValue: nil) | |
let aTask = Ref<Task<Void, Error>?>(initialValue: nil) | |
let bCurrentValue = Ref<B.Element?>(initialValue: nil) | |
let bTask = Ref<Task<Void, Error>?>(initialValue: nil) | |
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
package com.cardlay.nebula.shared.query | |
class MapTree<K, V : Any> : MutableTree<K, V> { | |
private class MutableNode<K, V : Any> : Tree.Node<K, V> { | |
override val nodes = mutableMapOf<K, MutableNode<K, V>>() | |
override var value: V? = null | |
val size: Int | |
get() { | |
if (value != null) { |
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 Swinject | |
private let prefix = "<asOneOf:" | |
private func nameOf<T>(_ serviceType: T) -> String { | |
return "\(prefix):\(String(reflecting: serviceType))>" | |
} | |
class AggregateBehavior<Common> : Behavior { | |
private var factories: [(Resolver) -> Common?] = [] |
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 | |
enum PublisherTimeoutError<Failure>: Error where Failure: Error { | |
case failure(Failure) | |
case timeout | |
} | |
extension Publisher { | |
func timeoutToNil<S>(after interval: S.SchedulerTimeType.Stride, scheduler: S) -> AnyPublisher<Output?, Failure> where S: Scheduler { | |
mapError({ error -> PublisherTimeoutError<Failure> in .failure(error) }) |
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 | |
import SwiftUI | |
/// Contains the gap between the smallest value for the y-coordinate of | |
/// the frame layer and the content layer. | |
private struct ContentOffsetPreferenceKey: PreferenceKey { | |
static var defaultValue: CGPoint = .zero | |
static func reduce(value: inout CGPoint, nextValue: () -> CGPoint) {} | |
} |
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 | |
extension Publishers { | |
struct MissingOutputError : Error {} | |
} | |
extension Future where Failure == Never { | |
var value: Output { | |
get async { | |
var cancellable: AnyCancellable? = nil |
NewerOlder