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
// | |
// TCAStoreCachingApp.swift | |
// TCAStoreCaching | |
// | |
// Created by Luke Redpath on 11/03/2024. | |
// | |
import ComposableArchitecture | |
import SwiftUI |
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 ComposableArchitecture | |
import XCTest | |
struct BindingTestFeature: ReducerProtocol { | |
struct State: Equatable { | |
@BindingState | |
var value: Int = 0 | |
} | |
enum Action: Equatable, BindableAction { |
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
struct StoreScope<State, Action, ChildState, ChildAction> { | |
typealias Scope<_State, _Action> = StoreScope<State, Action, _State, _Action> | |
typealias ScopeOf<R: ReducerProtocol> = StoreScope<State, Action, R.State, R.Action> | |
typealias PresentationScope<_State, _Action> = StoreScope<State, Action, PresentationState<_State>, PresentationAction<_Action>> | |
typealias PresentationScopeOf<R: ReducerProtocol> = StoreScope<State, Action, PresentationState<R.State>, PresentationAction<R.Action>> | |
var toChildState: (State) -> ChildState | |
var fromChildAction: (ChildAction) -> Action | |
} |
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
Copyright 2023 Luke Redpath | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHE |
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
// Taken from https://github.com/pointfreeco/swift-snapshot-testing/pull/628/files | |
import Foundation | |
import SwiftUI | |
@testable import SnapshotTesting | |
#if os(iOS) || os(tvOS) | |
import CoreImage.CIFilterBuiltins | |
import UIKit |
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 Combine | |
import Foundation | |
let wrapper = Wrapper(createPublisher: { Just("foo").eraseToAnyPublisher() }) | |
// This will not produce any auto-complete suggestions | |
wrapper.createPublisher(). | |
struct Wrapper { | |
var createPublisher: () -> AnyPublisher<String, Never> |
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
// Compiles in Xcode 12.5, but not 12.4 | |
var foo: Foo { | |
#if DEBUG | |
Foo(debug: true) | |
#else | |
Foo() | |
#end | |
} | |
// Compiles in both |
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
Apache License | |
Version 2.0, January 2004 | |
http://www.apache.org/licenses/ | |
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
1. Definitions. | |
"License" shall mean the terms and conditions for use, reproduction, | |
and distribution as defined by Sections 1 through 9 of this document. |
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
enum AppState: Equatable { | |
case featureOne(FeatureState) | |
case featureTwo(FeatureState) | |
case featureThree(FeatureState) | |
} | |
enum AppAction: Equatable { | |
case featureOne(FeatureAction) | |
case featureTwo(FeatureAction) | |
case featureThree(FeatureAction) |
NewerOlder