r/purescript • u/goertzenator • Oct 11 '17
Halogen destroyed components
I've gone through the Halogen guide and am still trying to wrap my head around how it all works. My questions at the moment are about deletion; consider the TODO example that comes with Halogen:
- When a task is removed from the todo list, the parent render function no longer performs a slot call for that task. Does all information for that task get destroyed at that point?
- Can that task id be reused at some later point in time?
- What happens if a removed component had say an AJAX request in flight?
4
Upvotes
View all comments
Show parent comment
1
u/goertzenator Oct 12 '17
Thank you. My mental model of Halogen is starting to firm up but now I'm hung up on the execution context of the query algebra. Consider the aff-ajax example: How would I go about implementing a "cancel" button to abort an in-flight ajax request? When the ajax request is being processed, the eval function looks "blocked" waiting for the request to finish and isn't ready to handle a "CancelClicked" query.