CombineWrapper
public final class CombineWrapper : WebcomWrapper, Equatable, CustomDebugStringConvertible
The type that wraps DataService in order to enrich it with a Combine-based API.
See also the documentation section of WebcomWrapper for the corresponding wrapped type.
To use this type, import the following dependency in your code:
import WebcomCombine
-
Declaration
Swift
public let wrapped: DataService
-
Returns a reference to a database node.
This method always succeeds. If the
pathis ill-formed, it is the methods of the resulting instance that will fail.The path consists of segments separated by
/(slash) characters. Each segment corresponds to a move in the database tree:- The starting point is the root node of the database tree
- The
.segment is a no-operation. - The
..segment indicates to go one level up in the tree. When already at the root node, this is a no-operation. - The empty segment, when using a
/at the beginning or at the end of thepath, or when using several consecutive/, is a no-operation. Any other valid segment indicates to go one level down towards the so-named child.
Declaration
Swift
public func node(for path: String) -> DataNode.CombineWrapperParameters
pathThe absolute path of the node to refer. It can start or not with a
/(slash) character. It is always absolute.Return Value
A reference to the node corresponding to the
path. -
Update the device token of all subscriptions through remote notifications (push notifications) that are stored.
If a subscription has failed, especially if the device token was not available at that time, it is still stored so that this method can (try to) update it. Subscriptions for which the device token has not changed are not affected by this method.
Declaration
Swift
public func updateDeviceTokenInAllSubscriptions(file: StaticString = #fileID, line: UInt = #line, session: URLSession? = nil) -> Future<Void, Never>Parameters
fileThe file from which the method is called. This is used for debugging purposes.
lineThe line from which the method is called. This is used for debugging purposes.
sessionThe session used to send the requests to the back-end. When
nil, the default session of the application of this instance is used.Return Value
A future with a void value.
-
Declaration
Swift
public func updateDeviceTokenInAllSubscriptions(file: StaticString = #fileID, line: UInt = #line, session: URLSession? = nil) async throws -
Cancels all subscriptions through remote notifications (push notifications) that are stored.
This method cancels subscriptions stored by the
DataNode.CombineWrapper.subscribeThroughNotifications(descriptor:file:line:session:)method.Declaration
Swift
public func unsubscribeFromAllThroughNotifications(session: URLSession? = nil) -> Future<Void, Never>Parameters
sessionThe session used to send the requests to the back-end. When
nil, the default session of the application of this instance is used.Return Value
A future with a void value that never fails.
-
unsubscribeFromAllThroughNotifications(session:Asynchronous) Declaration
Swift
public func unsubscribeFromAllThroughNotifications(session: URLSession? = nil) async throws -
Cancels all subscriptions through webhooks that are stored.
This method cancels subscriptions stored by the
DataNode.CombineWrapper.subscribeThroughWebhook(descriptor:file:line:session:)method.Declaration
Swift
public func unsubscribeFromAllThroughWebhook(session: URLSession? = nil) -> Future<Void, Never>Parameters
sessionThe session used to send the requests to the back-end. When
nil, the default session of the application of this instance is used.Return Value
A future with a void value that never fails.
-
unsubscribeFromAllThroughWebhook(session:Asynchronous) Declaration
Swift
public func unsubscribeFromAllThroughWebhook(session: URLSession? = nil) async throws