Skip to content

Commit 0bfe053

Browse files
committed
_
1 parent 8b2ed5e commit 0bfe053

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/pharaoh/lib/src/_next/core.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,21 @@ abstract class ApplicationFactory {
114114
final spanner = Spanner()..addMiddleware('/', bodyParser);
115115
Application._instance = _PharaohNextImpl(config, spanner);
116116

117-
final providerInstances = providers.map(createNewInstance<ServiceProvider>);
117+
final providerInstances = providers
118+
.map(createNewInstance<ServiceProvider>)
119+
.toList(growable: false);
118120

119121
/// register dependencies
120-
for (final instance in providerInstances) {
121-
await Future.sync(instance.register);
122-
}
122+
await providerInstances
123+
.map((provider) => Future.sync(provider.register))
124+
.wait;
123125

124126
if (globalMiddleware != null) {
125127
spanner.addMiddleware<Middleware>('/', globalMiddleware!);
126128
}
127129

128130
/// boot providers
129-
for (final provider in providerInstances) {
130-
await Future.sync(provider.boot);
131-
}
131+
await providerInstances.map((provider) => Future.sync(provider.boot)).wait;
132132
}
133133

134134
static RequestHandler buildControllerMethod(ControllerMethod method) {

0 commit comments

Comments
 (0)