AsyncScriptStep

public class AsyncScriptStep : ScriptStep

Step that runs some script which will return a result asynchronously via SwiftScraper.postMessage().

The StepFlowResult returned by the handler can be used to drive control flow of the steps.

  • Initializer.

    Declaration

    Swift

    override public init(
        functionName: String,
        params: Any...,
        paramsKeys: [String] = [],
        handler: @escaping ScriptStepHandler
    )

    Parameters

    functionName

    The name of the JavaScript function to call. The module namespace is automatically added.

    params

    Parameters which will be passed to the JavaScript function.

    paramsKeys

    Look up the values from the JSON model dictionary using these keys, and pass them as the parameters to the JavaScript function. If provided, these are used instead of params.

    handler

    Callback function which returns data from JavaScript, and passes the model JSON dictionary for modification.