File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
pkg/dev_compiler/lib/js/ddc Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1618,7 +1618,14 @@ if (!self.deferred_loader) {
16181618 ) ;
16191619 }
16201620 await Promise . all ( reloadFilePromises ) . then ( ( _ ) => {
1621- this . hotReloadEnd ( ) ;
1621+ if ( dartDevEmbedderConfig . captureHotReloadEndHandler != null ) {
1622+ // Let the app decide when to update the libraries.
1623+ dartDevEmbedderConfig . captureHotReloadEndHandler ( ( ) => {
1624+ this . hotReloadEnd ( ) ;
1625+ } ) ;
1626+ } else {
1627+ this . hotReloadEnd ( ) ;
1628+ }
16221629 } ) ;
16231630 }
16241631
@@ -2053,6 +2060,16 @@ if (!self.deferred_loader) {
20532060 * @type {?function() }
20542061 */
20552062 mainErrorCallback = null ;
2063+
2064+ /*
2065+ * An optional handler that acts as a wrapper around the push of the hot
2066+ * reloaded libraries into the Dart runtime which completes the hot reload.
2067+ * Passed an opaque function as an argument that pushes the libraries that
2068+ * were previously loaded into the page during a call to
2069+ * `DartDevEmbedder.hotReload` when called.
2070+ * @type {?function(function()) }
2071+ */
2072+ captureHotReloadEndHandler = null ;
20562073 }
20572074
20582075 const dartDevEmbedderConfig = new DartDevEmbedderConfiguration ( ) ;
You can’t perform that action at this time.
0 commit comments