From fa960ae722cb4bd42f8a8feb49f83b87e6cf7126 Mon Sep 17 00:00:00 2001 From: Kevin O'Neill Date: Fri, 9 Aug 2019 11:01:11 +1000 Subject: [PATCH] fix: correct visability of containers --- Sources/SwifTEA/StateContainer.swift | 14 +++++++------- Sources/SwifTEA/StoreContainer.swift | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Sources/SwifTEA/StateContainer.swift b/Sources/SwifTEA/StateContainer.swift index 6223780..90aa3cd 100644 --- a/Sources/SwifTEA/StateContainer.swift +++ b/Sources/SwifTEA/StateContainer.swift @@ -8,8 +8,8 @@ import SwiftUI -struct StateContainer: View where Content: View { - typealias Dispatcher = Store.Dispatcher +public struct StateContainer: View where Content: View { + public typealias Dispatcher = Store.Dispatcher @EnvironmentObject private var store: Store @EnvironmentObject private var dispatcher: Dispatcher @@ -27,20 +27,20 @@ struct StateContainer: View where C } } -extension StateContainer { - public init(_ keypath: KeyPath, render: @escaping (Props, Dispatcher) -> Content) { +public extension StateContainer { + init(_ keypath: KeyPath, render: @escaping (Props, Dispatcher) -> Content) { self.init(read: { $0[keyPath: keypath] }, render: render) } - public init(_ a: KeyPath, _ b: KeyPath, render: @escaping ((A, B), Dispatcher) -> Content) where Props == (A, B) { + init(_ a: KeyPath, _ b: KeyPath, render: @escaping ((A, B), Dispatcher) -> Content) where Props == (A, B) { self.init(read: { ($0[keyPath: a], $0[keyPath: b]) }, render: render) } - public init(_ a: KeyPath, _ b: KeyPath, _ c: KeyPath, render: @escaping ((A, B, C), Dispatcher) -> Content) where Props == (A, B, C) { + init(_ a: KeyPath, _ b: KeyPath, _ c: KeyPath, render: @escaping ((A, B, C), Dispatcher) -> Content) where Props == (A, B, C) { self.init(read: { ($0[keyPath: a], $0[keyPath: b], $0[keyPath: c]) }, render: render) } - public init(_ a: KeyPath, _ b: KeyPath, _ c: KeyPath, _ d: KeyPath, render: @escaping ((A, B, C, D), Dispatcher) -> Content) where Props == (A, B, C, D) { + init(_ a: KeyPath, _ b: KeyPath, _ c: KeyPath, _ d: KeyPath, render: @escaping ((A, B, C, D), Dispatcher) -> Content) where Props == (A, B, C, D) { self.init(read: { ($0[keyPath: a], $0[keyPath: b], $0[keyPath: c], $0[keyPath: d]) }, render: render) } } diff --git a/Sources/SwifTEA/StoreContainer.swift b/Sources/SwifTEA/StoreContainer.swift index 27247c7..1a5b69a 100644 --- a/Sources/SwifTEA/StoreContainer.swift +++ b/Sources/SwifTEA/StoreContainer.swift @@ -9,18 +9,18 @@ import SwiftUI import WeeDux -struct StoreContainer: View where Content: View { +public struct StoreContainer: View where Content: View { @ObservedObject private var store: Store private let content: () -> Content - var body: some View { + public var body: some View { content() .environmentObject(self.store) .environmentObject(self.store.dispatcher) } - init(for store: Store, content: @escaping () -> Content) { + public init(for store: Store, content: @escaping () -> Content) { self.store = store self.content = content }