changed ListPublisher and ObjectPublisher factory method naming to match ListMonitor and ObjectMonitor naming

This commit is contained in:
John Estropia
2019-10-25 12:43:39 +09:00
parent f380d9dc25
commit 11a9e3991c

View File

@@ -39,7 +39,7 @@ extension DataStack {
- parameter object: the `DynamicObject` to observe changes from
- returns: an `ObjectPublisher` that broadcasts changes to `object`
*/
public func objectPublisher<O: DynamicObject>(_ object: O) -> ObjectPublisher<O> {
public func publishObject<O: DynamicObject>(_ object: O) -> ObjectPublisher<O> {
return ObjectPublisher<O>(objectID: object.cs_id(), context: self.unsafeContext())
}
@@ -51,9 +51,9 @@ extension DataStack {
- parameter fetchClauses: a series of `FetchClause` instances for fetching the object list. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: a `ListPublisher` that broadcasts changes to the fetched results
*/
public func listPublisher<O>(_ from: From<O>, _ fetchClauses: FetchClause...) -> ListPublisher<O> {
public func publishList<O>(_ from: From<O>, _ fetchClauses: FetchClause...) -> ListPublisher<O> {
return self.listPublisher(from, fetchClauses)
return self.publishList(from, fetchClauses)
}
/**
@@ -63,7 +63,7 @@ extension DataStack {
- parameter fetchClauses: a series of `FetchClause` instances for fetching the object list. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: a `ListPublisher` that broadcasts changes to the fetched results
*/
public func listPublisher<O>(_ from: From<O>, _ fetchClauses: [FetchClause]) -> ListPublisher<O> {
public func publishList<O>(_ from: From<O>, _ fetchClauses: [FetchClause]) -> ListPublisher<O> {
return ListPublisher(
dataStack: self,
@@ -99,9 +99,9 @@ extension DataStack {
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: a `ListPublisher` that broadcasts changes to the fetched results
*/
public func listPublisher<B: FetchChainableBuilderType>(_ clauseChain: B) -> ListPublisher<B.ObjectType> {
public func publishList<B: FetchChainableBuilderType>(_ clauseChain: B) -> ListPublisher<B.ObjectType> {
return self.listPublisher(
return self.publishList(
clauseChain.from,
clauseChain.fetchClauses
)
@@ -115,9 +115,9 @@ extension DataStack {
- parameter fetchClauses: a series of `FetchClause` instances for fetching the object list. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: a `ListPublisher` that broadcasts changes to the fetched results
*/
public func listPublisher<O>(_ from: From<O>, _ sectionBy: SectionBy<O>, _ fetchClauses: FetchClause...) -> ListPublisher<O> {
public func publishList<O>(_ from: From<O>, _ sectionBy: SectionBy<O>, _ fetchClauses: FetchClause...) -> ListPublisher<O> {
return self.listPublisher(
return self.publishList(
from,
sectionBy,
fetchClauses
@@ -132,7 +132,7 @@ extension DataStack {
- parameter fetchClauses: a series of `FetchClause` instances for fetching the object list. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: a `ListPublisher` that broadcasts changes to the fetched results
*/
public func listPublisher<O>(_ from: From<O>, _ sectionBy: SectionBy<O>, _ fetchClauses: [FetchClause]) -> ListPublisher<O> {
public func publishList<O>(_ from: From<O>, _ sectionBy: SectionBy<O>, _ fetchClauses: [FetchClause]) -> ListPublisher<O> {
return ListPublisher(
dataStack: self,
@@ -169,14 +169,59 @@ extension DataStack {
- parameter clauseChain: a `SectionMonitorBuilderType` built from a chain of clauses
- returns: a `ListPublisher` that broadcasts changes to the fetched results
*/
public func listPublisher<B: SectionMonitorBuilderType>(_ clauseChain: B) -> ListPublisher<B.ObjectType> {
public func publishList<B: SectionMonitorBuilderType>(_ clauseChain: B) -> ListPublisher<B.ObjectType> {
return self.listPublisher(
return self.publishList(
clauseChain.from,
clauseChain.sectionBy,
clauseChain.fetchClauses
)
}
// MARK: - Deprecated
@available(*, deprecated, renamed: "publishObject(_:)")
public func objectPublisher<O: DynamicObject>(_ object: O) -> ObjectPublisher<O> {
return self.publishObject(object)
}
@available(*, deprecated, renamed: "publishList(_:_:)")
public func listPublisher<O>(_ from: From<O>, _ fetchClauses: FetchClause...) -> ListPublisher<O> {
return self.publishList(from, fetchClauses)
}
@available(*, deprecated, renamed: "publishList(_:_:)")
public func listPublisher<O>(_ from: From<O>, _ fetchClauses: [FetchClause]) -> ListPublisher<O> {
return self.publishList(from, fetchClauses)
}
@available(*, deprecated, renamed: "publishList(_:)")
public func listPublisher<B: FetchChainableBuilderType>(_ clauseChain: B) -> ListPublisher<B.ObjectType> {
return self.publishList(clauseChain)
}
@available(*, deprecated, renamed: "publishList(_:_:_:)")
public func listPublisher<O>(_ from: From<O>, _ sectionBy: SectionBy<O>, _ fetchClauses: FetchClause...) -> ListPublisher<O> {
return self.publishList(from, sectionBy, fetchClauses)
}
@available(*, deprecated, renamed: "publishList(_:_:_:)")
public func listPublisher<O>(_ from: From<O>, _ sectionBy: SectionBy<O>, _ fetchClauses: [FetchClause]) -> ListPublisher<O> {
return self.publishList(from, sectionBy, fetchClauses)
}
@available(*, deprecated, renamed: "publishList(_:)")
public func listPublisher<B: SectionMonitorBuilderType>(_ clauseChain: B) -> ListPublisher<B.ObjectType> {
return self.publishList(clauseChain)
}
}
#endif