Skip to content

Instantly share code, notes, and snippets.

View taskcruncher's full-sized avatar

Taskcruncher Project and Task Manager taskcruncher

View GitHub Profile
//
// ContentView.swift
// scopetest
//
// Created by Steedman Bass on 11/6/22.
//
import ComposableArchitecture
import SwiftUI
received action:
TCAuthAction.simpAuthAction(
TCSimpAuthAction.attemptAuth(
SimpUsername(asString: "7928xxxxx@taskcruncher.com"),
SimpPassword(asString: "xxxx")
)
)
(No state changes)
@taskcruncher
taskcruncher / BaseStateExampleWithGenericAppState.swift
Last active August 8, 2023 17:09
BaseStateExampleWithGenericAppState.swift
//How to use BaseState struct to share state between views in TCA architecture.
// https://forums.swift.org/t/best-practice-for-sharing-data-between-many-features/37696/4
//This is a proof-of-concept only; it simply is an attempt to model how to get and set global shared state among different views in a TCA-style app.
import SwiftUI
import ComposableArchitecture
@dynamicMemberLookup
struct TCABaseState<State: Equatable>: Equatable{