MCPcopy
hub / github.com/single-spa/single-spa / loadApps

Function loadApps

src/navigation/reroute.js:109–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107 }
108
109 function loadApps() {
110 return Promise.resolve().then(() => {
111 const loadPromises = appsToLoad.map(toLoadPromise);
112 let succeeded;
113
114 return (
115 Promise.all(loadPromises)
116 .then(callAllEventListeners)
117 // there are no mounted apps, before start() is called, so we always return []
118 .then(() => {
119 if (__PROFILE__) {
120 succeeded = true;
121 }
122
123 return [];
124 })
125 .catch((err) => {
126 if (__PROFILE__) {
127 succeeded = false;
128 }
129
130 callAllEventListeners();
131 throw err;
132 })
133 .finally(() => {
134 if (__PROFILE__) {
135 addProfileEntry(
136 "routing",
137 "loadApps",
138 profilerKind,
139 startTime,
140 performance.now(),
141 succeeded
142 );
143 }
144 })
145 );
146 });
147 }
148
149 function performAppChanges() {
150 return Promise.resolve().then(() => {

Callers 1

rerouteFunction · 0.85

Calls 2

addProfileEntryFunction · 0.90
callAllEventListenersFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…