natefaubion / purescript-spork

Elm-like for PureScript
MIT License
157 stars 9 forks source link

Subscription interpreter helpers #9

Open natefaubion opened 6 years ago

natefaubion commented 6 years ago

Most subscriptions needs to keep a closure over mutable internal state that's separate from the EventQueue machine state for callbacks and such. That way we can actually invoke the continuations when receiving events from the outside world. This can be coordinated manually with a ref, but we can provide a utility over this pattern.