Skip to content

Commit e0e8eac

Browse files
committed
Add defaults to registry and fix connect state
1 parent e304362 commit e0e8eac

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Sources/LiveViewNative/Coordinators/LiveViewCoordinator.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public class LiveViewCoordinator<R: CustomRegistry>: ObservableObject {
133133
if let channel {
134134
guard !channel.isJoined, !channel.isJoining else { return }
135135
}
136+
internalState = .startingConnection
136137
do {
137138
try await connectLiveView()
138139
} catch {

Sources/LiveViewNative/CustomRegistry.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public protocol CustomRegistry {
5454
/// typealias TagName = EmptyRegistry.None
5555
/// }
5656
/// ```
57-
associatedtype TagName: RawRepresentable where TagName.RawValue == String
57+
associatedtype TagName: RawRepresentable = EmptyRegistry.None where TagName.RawValue == String
5858
/// A type represnting the custom modifier types that this registry can handle.
5959
///
6060
/// This type must be `RawRepresentable` and its raw values must be strings.
@@ -75,15 +75,15 @@ public protocol CustomRegistry {
7575
/// typealias ModifierType = EmptyRegistry.None
7676
/// }
7777
/// ```
78-
associatedtype ModifierType: RawRepresentable where ModifierType.RawValue == String
78+
associatedtype ModifierType: RawRepresentable = EmptyRegistry.None where ModifierType.RawValue == String
7979
/// The type of view this registry returns from the `lookup` method.
8080
///
8181
/// Generally, implementors will use an opaque return type on their ``lookup(_:element:context:)-895au`` implementations and this will be inferred automatically.
82-
associatedtype CustomView: View
82+
associatedtype CustomView: View = Never
8383
/// The type of view this registry produces for loading views.
8484
///
8585
/// Generally, implementors will use an opaque return type on their ``loadingView(for:state:)-2uoy9`` implementations and this will be inferred automatically.
86-
associatedtype LoadingView: View
86+
associatedtype LoadingView: View = Never
8787

8888
/// This method is called by LiveView Native when it needs to construct a custom view.
8989
///

0 commit comments

Comments
 (0)