Skip to content

Commit 782c82a

Browse files
janwirthJan Wirth
authored and
Jan Wirth
committed
Implement app.shutdown() function
1 parent 65cea00 commit 782c82a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Elm/Kernel/Platform.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ function _Platform_initialize(flagDecoder, args, init, update, subscriptions, st
5151

5252
_Platform_enqueueEffects(managers, initPair.b, subscriptions(model));
5353

54-
return ports ? { ports: ports } : {};
54+
const shutdown = function() {
55+
managers = null
56+
model = null
57+
stepper = null
58+
ports = null
59+
}
60+
61+
return ports ? { ports: ports, shutdown: shutdown } : { shutdown: shutdown };
5562
}
5663

5764

0 commit comments

Comments
 (0)