kiran-jejurkar / jquery-stream

Automatically exported from code.google.com/p/jquery-stream
0 stars 0 forks source link

Improvement: give source of event #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Here's an improvement:
If you fire an event, you should always give the source(the stream, that's 
fireing the event) to the event-handler. (onmessage, onerror, onclose, ...).

If the source is delivered, there's no need to wrap something.

Greetings

Original issue reported on code.google.com by sebastia...@gmail.com on 23 Jul 2011 at 11:23

GoogleCodeExporter commented 9 years ago
As of 1.1, every event handler receives the corresponding stream object as a 
formal parameter.

For example,

$.stream(url, {
    open: function(event, stream) {
        // 'stream' is the same with $.stream(url)
    }
});

Original comment by flowersi...@gmail.com on 28 Jul 2011 at 5:45