Skip to content

Commit

Permalink
_
Browse files Browse the repository at this point in the history
  • Loading branch information
codekeyz committed Nov 30, 2024
1 parent 8b2ed5e commit 0bfe053
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/pharaoh/lib/src/_next/core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,21 @@ abstract class ApplicationFactory {
final spanner = Spanner()..addMiddleware('/', bodyParser);
Application._instance = _PharaohNextImpl(config, spanner);

final providerInstances = providers.map(createNewInstance<ServiceProvider>);
final providerInstances = providers
.map(createNewInstance<ServiceProvider>)
.toList(growable: false);

/// register dependencies
for (final instance in providerInstances) {
await Future.sync(instance.register);
}
await providerInstances
.map((provider) => Future.sync(provider.register))
.wait;

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

/// boot providers
for (final provider in providerInstances) {
await Future.sync(provider.boot);
}
await providerInstances.map((provider) => Future.sync(provider.boot)).wait;
}

static RequestHandler buildControllerMethod(ControllerMethod method) {
Expand Down

0 comments on commit 0bfe053

Please sign in to comment.