@casual-simulation/aux-common
Version:
Common library for AUX projects
18 lines • 669 B
JavaScript
/**
* Creates an AUX Partition from the given list of factory functions.
* The first factory function that returns a partition is the partition
* that gets returned.
* @param config The config which indicates the type of partition to create.
* @param services The services which should be used by the partitions.
* @param factories The factory functions.
*/
export async function createAuxPartition(config, services, ...factories) {
for (let factory of factories) {
let result = await factory(config, services);
if (result) {
return result;
}
}
return undefined;
}
//# sourceMappingURL=AuxPartitionFactories.js.map