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.OperationParameters
rawUse the
.rawvalue to disambiguate with theset(_:)overload that takes anEncodableparameter.jsonThe value to set. It must be valid JSON (object, array, string, number, boolean or
null). Thenullvalue can be specified withnilorNSNull(). -
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.OperationParameters
valueThe value to set. It will be encoded to JSON before being sent to the back-end, using the
WebcomApplication.jsonDecoderof theWebcomApplicationfrom which the node derives. Thenullvalue can be specified withnilorNSNull().