Operation
public enum Operation
A value representing an operation to be performed by a transaction on a given node.
-
An operation that clears the value of the node.
This corresponds to what the
DatasyncNode.clear(at:queue:then:)
method does, but in a transactional way.Declaration
Swift
case clear
-
An operation that sets the value of the node.
This value is not designed to be used directly.
set(_:)
orset(_:_:)
methods should be rather used.Declaration
Swift
case set((DatasyncManager) -> Any?)
-
An operation that does not modify the node and aborts the transaction.
Declaration
Swift
case abort
-
Returns an operation that sets the value of the node.
This corresponds to what the
DatasyncNode.set(_:_:at:queue:then:)
method does, but in a transactional way.Declaration
Swift
public static func set(_ raw: WebcomMarkers.Raw, _ json: Any?) -> DatasyncTransaction.Operation
Parameters
raw
Use the
.raw
value to disambiguate with theset(_:)
overload that takes anEncodable
parameter.json
The value to set. It must be valid JSON (object, array, string, number, boolean or
null
). Thenull
value can be specified withnil
orNSNull()
. -
Returns an operation that sets the value of the node.
This corresponds to what the
DatasyncNode.set(_:at:queue:then:)
method does, but in a transactional way.Declaration
Swift
public static func set(_ value: some Encodable) -> DatasyncTransaction.Operation
Parameters
value
The value to set. It will be encoded to JSON before being sent to the back-end, using the
WebcomApplication.jsonDecoder
of theWebcomApplication
from which the node derives. Thenull
value can be specified withnil
orNSNull()
.