Guest User

Untitled

a guest
Dec 18th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. var eventSource;
  2. function onChange(accountId:string, callback){
  3. var url = "...";
  4.  
  5. eventSource = new EventSource(url);
  6.  
  7. if(eventSource){
  8. eventSource.addEventListener("put", callback);
  9. }
  10. }
  11.  
  12. function close(){
  13. this.eventSource.close()
  14. }
Add Comment
Please, Sign In to add comment