Skip to content

Commit e8342a9

Browse files
committed
Refine app.die() with Simon's discovery re Time subscriptions
1 parent 113ecca commit e8342a9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

extra/Lamdera/Injection.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,16 @@ injections isBackend isLocalDev =
294294

295295
const die = function() {
296296
//console.log('App dying');
297+
298+
// Needed to stop Time.every subscriptions.
299+
// This must be done before clearing the stuff below.
300+
_Platform_enqueueEffects(managers, _Platform_batch(_List_Nil), _Platform_batch(_List_Nil));
301+
297302
managers = null;
298303
model = null;
299304
stepper = null;
300305
ports = null;
301306
_Platform_effectsQueue = [];
302-
303-
// Do we need to call these functions? Or will the `= []` be enough?
304-
// _Platform_enqueueEffects(managers, $$elm$$core$$Platform$$Cmd$$none, $$elm$$core$$Platform$$Sub$$none);
305-
// _Platform_enqueueEffects(managers, _Platform_batch(_List_Nil), _Platform_batch(_List_Nil));
306307
}
307308

308309
return ports ? {

0 commit comments

Comments
 (0)