diff --git a/Sources/DataStack+DataSources.swift b/Sources/DataStack+DataSources.swift index cb3684a..cba6d2a 100644 --- a/Sources/DataStack+DataSources.swift +++ b/Sources/DataStack+DataSources.swift @@ -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(_ object: O) -> ObjectPublisher { + public func publishObject(_ object: O) -> ObjectPublisher { return ObjectPublisher(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(_ from: From, _ fetchClauses: FetchClause...) -> ListPublisher { + public func publishList(_ from: From, _ fetchClauses: FetchClause...) -> ListPublisher { - 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(_ from: From, _ fetchClauses: [FetchClause]) -> ListPublisher { + public func publishList(_ from: From, _ fetchClauses: [FetchClause]) -> ListPublisher { 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(_ clauseChain: B) -> ListPublisher { + public func publishList(_ clauseChain: B) -> ListPublisher { - 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(_ from: From, _ sectionBy: SectionBy, _ fetchClauses: FetchClause...) -> ListPublisher { + public func publishList(_ from: From, _ sectionBy: SectionBy, _ fetchClauses: FetchClause...) -> ListPublisher { - 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(_ from: From, _ sectionBy: SectionBy, _ fetchClauses: [FetchClause]) -> ListPublisher { + public func publishList(_ from: From, _ sectionBy: SectionBy, _ fetchClauses: [FetchClause]) -> ListPublisher { 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(_ clauseChain: B) -> ListPublisher { + public func publishList(_ clauseChain: B) -> ListPublisher { - return self.listPublisher( + return self.publishList( clauseChain.from, clauseChain.sectionBy, clauseChain.fetchClauses ) } + + + // MARK: - Deprecated + + @available(*, deprecated, renamed: "publishObject(_:)") + public func objectPublisher(_ object: O) -> ObjectPublisher { + + return self.publishObject(object) + } + + @available(*, deprecated, renamed: "publishList(_:_:)") + public func listPublisher(_ from: From, _ fetchClauses: FetchClause...) -> ListPublisher { + + return self.publishList(from, fetchClauses) + } + + @available(*, deprecated, renamed: "publishList(_:_:)") + public func listPublisher(_ from: From, _ fetchClauses: [FetchClause]) -> ListPublisher { + + return self.publishList(from, fetchClauses) + } + + @available(*, deprecated, renamed: "publishList(_:)") + public func listPublisher(_ clauseChain: B) -> ListPublisher { + + return self.publishList(clauseChain) + } + + @available(*, deprecated, renamed: "publishList(_:_:_:)") + public func listPublisher(_ from: From, _ sectionBy: SectionBy, _ fetchClauses: FetchClause...) -> ListPublisher { + + return self.publishList(from, sectionBy, fetchClauses) + } + + @available(*, deprecated, renamed: "publishList(_:_:_:)") + public func listPublisher(_ from: From, _ sectionBy: SectionBy, _ fetchClauses: [FetchClause]) -> ListPublisher { + + return self.publishList(from, sectionBy, fetchClauses) + } + + @available(*, deprecated, renamed: "publishList(_:)") + public func listPublisher(_ clauseChain: B) -> ListPublisher { + + return self.publishList(clauseChain) + } } #endif