UNPKG

@casual-simulation/aux-common

Version:
18 lines 664 B
/** * Creates a shared document from the given list of factory functions. * The first factory function that returns a doc is the document * that gets returned. * @param config The config which indicates the type of document to create. * @param services The services which should be used by the document. * @param factories The factory functions. */ export async function createSharedDocument(config, services, ...factories) { for (let factory of factories) { let result = await factory(config, services); if (result) { return result; } } return undefined; } //# sourceMappingURL=SharedDocumentFactories.js.map