Skip to content

sc-sse is webcomponent to handling Server Side Events from HTML5

Notifications You must be signed in to change notification settings

horacioibrahim/sc-sse

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sc-sse

sc-sse is webcomponent to Server Side Events of HTML5

Usage

<body unresolved>
		<span>See console messages</span>
		
        <sc-sse stream="http://localhost:8080/stream" channel="userlogon" alias="updates"></sc-sse>

        <script>
        	var sse = document.querySelector('sc-sse');
        	sse.addEventListener('sc-sse-response', function(e) {
        		// channel is useful when to receives from one URL stream 
        		// that returns differents data as users, comments or issues 
        		// updates where theses are implemented in server side.
        		console.log("Reply from channel[userlogon]: " + e.detail.response);
        		// alias is useful when multiple sc-sse in same page
        		console.log("Alias: " + e.detail.alias);
        	});
        </script>

</body>

About

sc-sse is webcomponent to handling Server Side Events from HTML5

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 100.0%