createBuilderContext()
Creates a BuilderContext with an optional configuration.
type createBuilderContext = (context: BuilderContext, validatedMap: RecordMap) => Store;
Return value
Returns a BuilderContext required for buildStaticStore().
Params
༶ context
: BuilderContext
A context object that exposes the BuilderOptions and collects eventual errors produced building the store.
It is recommended to declare the options object directly in a dd.config.mjs
file in the root of the project and then load it via loadConfig().
Params
༶ validatedMap
: RecordMap
Holds all decision input data and provides an API to retrieve decision records and validation errors.
Usage
Create a context with configuration and provide to the buildStaticStore()
.
const config = await loadConfig();const context = createBuilderContext(config.store);const builder = buildStaticStore(context);