Skip to content

Commit

Permalink
Refine app.die() with Simon's discovery re Time subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
supermario committed May 5, 2024
1 parent 113ecca commit e8342a9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions extra/Lamdera/Injection.hs
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,16 @@ injections isBackend isLocalDev =

const die = function() {
//console.log('App dying');

// Needed to stop Time.every subscriptions.
// This must be done before clearing the stuff below.
_Platform_enqueueEffects(managers, _Platform_batch(_List_Nil), _Platform_batch(_List_Nil));

managers = null;
model = null;
stepper = null;
ports = null;
_Platform_effectsQueue = [];

// Do we need to call these functions? Or will the `= []` be enough?
// _Platform_enqueueEffects(managers, $$elm$$core$$Platform$$Cmd$$none, $$elm$$core$$Platform$$Sub$$none);
// _Platform_enqueueEffects(managers, _Platform_batch(_List_Nil), _Platform_batch(_List_Nil));
}

return ports ? {
Expand Down

0 comments on commit e8342a9

Please sign in to comment.