opal / opal-browser

Browser support for Opal.
MIT License
115 stars 36 forks source link

Explicitly forward events to Event::Progress #39

Closed ajjahn closed 9 years ago

ajjahn commented 9 years ago

@meh The problem was the HTTP::Request object allows other callbacks that are not in the STATES constant. Particularly, it fires 'success' or 'failure' when a request is complete based on the response code. Furthermore, it looks like HTTP::Request also will fire callbacks for specific response codes:

request.on '200' do
  ...
end

So I swapped the filter for callbacks based on what Event::Progress handles. Working much better now.

meh commented 9 years ago

Merged.