File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
packages/pharaoh/lib/src/_next Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff 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) {
You can’t perform that action at this time.
0 commit comments