Data Input

Input type passed to components

Overview

The DataInput struct is what holds data that is passed into a component as an input. The DataInput provides information on the input as well as the data itself in the type unwrapped AnyCloneableData

AnyCloneableData

Swift Structure

The following is the structure of the DataInput struct

public struct DataInput: CloneableDataInput {
    public var componentDynamicID: String
    public var inputDynamicID: String
    public var inputStaticID: String
    public var data: AnyCloneableData // Type erased container holding the actual data

    // information about the input
    public var batch: Int? // which group of inputs in the workflow was this, incrementing int
    public var creationTime: Date
    public var currentBatch: Bool // If this is the most recent batch of inputs, or an old batch
}

Tips

Best practices will continue to be added

Use currentBatch for advanced processing

You can use the currentBatch parameter to determine if you want to process an input or not. This comes into play if inputs are sent to a component prior to the component being initialized. This is usually only applicable when a dealing with UI components. In some cases you may want to retain or utilize inputs that were sent to the component prior to the component being rendered

Last updated