Skip to content

Conversation

@hussachai
Copy link
Contributor

I just implemented Chat sample app using SSE but it's not in the package. So, I added one.
Ref.
http://www.w3.org/TR/2012/WD-eventsource-20120426/#the-eventsource-interface

@hussachai
Copy link
Contributor Author

I'm sorry if I gave you too little information. The EventSource from MDN is not up-to-update.
So, I used W3C as a reference instead. I googled and found that there are 3 drafts from 2009,
2011, 2012. I used the latest one and tested with Chrome and Firefox.
You can see the implementation here
https://github.com/hussachai/play-scalajs-showcase/blob/sse/scalajs/src/main/scala/example/ChatJS.scala

The event type is not specified in W3C draft but I checked with 2 browsers as I mentioned above.
The settings parameter is supposed to be dictionary. I tried to use Map but it didn't work, so I used
js.Dynamic instead.

@lihaoyi
Copy link
Contributor

lihaoyi commented Jul 29, 2014

Sorry, haven't taken time to look at this yet. Will get to it at some point when I have time to go familiarize myself with the spec.

I feel that I should at least understand what I'm merging before I merge it, which is why I haven't merged it yet =)

@hussachai
Copy link
Contributor Author

Not a problem :)
I just want to give you more info about what I did. I hope it can save your time a bit.

lihaoyi added a commit that referenced this pull request Aug 11, 2014
@lihaoyi lihaoyi merged commit 96d133c into scala-js:master Aug 11, 2014
@lihaoyi
Copy link
Contributor

lihaoyi commented Aug 11, 2014

Looks good to me, thanks =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants