Updated README

This commit is contained in:
John Estropia
2021-04-11 11:03:17 +09:00
parent 593c0510d3
commit 1f562b25a7
13 changed files with 616 additions and 128 deletions

View File

@@ -70,7 +70,6 @@ public struct ListReader<Object: DynamicObject, Content: View, Value>: View {
self._list = .init(listPublisher)
self.content = content
self.keyPath = \.self
}
/**
@@ -98,8 +97,10 @@ public struct ListReader<Object: DynamicObject, Content: View, Value>: View {
) {
self._list = .init(listPublisher)
self.content = content
self.keyPath = keyPath
self.content = {
content($0[keyPath: keyPath])
}
}
@@ -107,17 +108,16 @@ public struct ListReader<Object: DynamicObject, Content: View, Value>: View {
public var body: some View {
self.content(self.list[keyPath: self.keyPath])
self.content(self.list)
}
// MARK: Private
@LiveList
@ListState
private var list: ListSnapshot<Object>
private let content: (Value) -> Content
private let keyPath: KeyPath<ListSnapshot<Object>, Value>
private let content: (ListSnapshot<Object>) -> Content
}
#endif