Operation

public enum Operation

A value representing an operation to be performed by a transaction on a given node.

Cases

  • 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(_:) or set(_:_:) 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

API

  • 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 the set(_:) overload that takes an Encodable parameter.

    json

    The value to set. It must be valid JSON (object, array, string, number, boolean or null). The null value can be specified with nil or NSNull().

  • 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 the WebcomApplication from which the node derives. The null value can be specified with nil or NSNull().