# @splunk/async-dynamic-options-evaluator

### AsyncDynamicOptionsEvaluator

A package that utilizes Web Workers to offload the work done within @splunk/visualization-encoding Options.evaluate to a seperate thread.

#### Input Parameters

-   visualizationID
-   props
-   options
-   dataSources
-   theme

#### Output

-   Promise that resolves and returns evaluated dynamic options

## Example Usage

```js
// WIP
AsyncDynamicOptionsEvaluator.evaluate({
    visualizationID: 'test-id',
    props: {},
    options: {},
    dataSources: {},
    theme: { background: () => '#ffffff' },
}).then(results => {
    /**
     results.results is the same as the return value from
     @splunk/visualization-encoding/Options.evaluate(
        {
            context: defaultsDeep({}, context, vizConfig.defaultContext),
            options: deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions),
        },
        dataSources,
        themeFunc
    );
    */
});
```
