z0w0/helm

Have some way to destroy the engine

z0w0 opened this issue · 2 comments

z0w0 commented

Currently Helm works like Elm does - there's no way to kill rendering (AFAIK). There needs to be some sort of state sent back as well as the Element objects used for rendering (as well as something like Sound). This state would allow you to signify that the engine should be destroyed.

It needs to be type-safe, though. We can't just use a Maybe Element or the equivalent; we have to force the user to never do anything after the engine is killed.

z0w0 commented

Note that this will be quite easy to implement in Helm 1.0. All that's needed is a new quit function that returns a Cmd that stops the engine at the next tick, which will then safely close up resources & is type safe.