Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var eventSource;
- function onChange(accountId:string, callback){
- var url = "...";
- eventSource = new EventSource(url);
- if(eventSource){
- eventSource.addEventListener("put", callback);
- }
- }
- function close(){
- this.eventSource.close()
- }
Add Comment
Please, Sign In to add comment