Skip to content

Commit b984dae

Browse files
authored
fix: accept thenable bootstrapFunction return values (#574) (#575)
1 parent b713ce6 commit b984dae

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

libs/single-spa-angular/src/single-spa-angular.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ApplicationRef, NgModuleRef, NgZone } from '@angular/core';
1+
import { ɵisPromise, type ApplicationRef, type NgModuleRef, type NgZone } from '@angular/core';
22
import type { LifeCycles } from 'single-spa';
33
import { getContainerElementAndSetTemplate } from 'single-spa-angular/internals';
44

@@ -99,7 +99,7 @@ async function mount(
9999

100100
const bootstrapPromise = options.bootstrapFunction(props);
101101

102-
if (!(bootstrapPromise instanceof Promise)) {
102+
if (!ɵisPromise(bootstrapPromise)) {
103103
throw Error(
104104
`single-spa-angular: the options.bootstrapFunction must return a promise, but instead returned a '${typeof bootstrapPromise}' that is not a Promise`,
105105
);

0 commit comments

Comments
 (0)