factory
| Generic types: | T R TCacheData |
The factory function is a powerful tool for creating complex builders. It should be used when you need to build something based on the results of multiple other builders.
Presentation
function factory (
tag: string,
builders: readonly ObservableInput <BuilderState <T>>[],
buildFn: (...args: T[]) => R | Promise<R>,
cacheStrategy?: CacheStrategy <TCacheData, R> | undefined,
): Builder <R>;Returns
Parameters
| Name | Type | Description |
|---|---|---|
| tag | string | A string that identifies the builder. |
| builders | readonly | An array of Observables of BuilderState. |
| buildFn | (...args: T[]) => R | Promise<R> | A function that takes the results of the successful Observables and returns a Promise. |
| cacheStrategy | | An optional CacheStrategy object. |