meow/Meow/Sources/Core/CatFacts+Meow.swift

26 lines
569 B
Swift

//
// CatFacts+Meow.swift
// Core
//
import Foundation
import CatFactsKit
import ComposableArchitecture
extension CatFacts: DependencyKey, TestDependencyKey {
public static var liveValue: CatFactsKit.CatFacts {
CatFacts(baseURL: URL(string: "https://barf.com")!)
}
public static var testValue: CatFactsKit.CatFacts {
CatFacts(baseURL: URL(string: "https://test.local")!)
}
}
public extension DependencyValues {
var catFacts: CatFacts {
get { self[CatFacts.self] }
set { self[CatFacts.self] = newValue }
}
}