Skip to content

zhusaidong/event-source

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

event-source

an event-source demo

use event-source to make a progress bar of demo

application

  • scan qr-code to login

what is event-source

EventSource

demo

demo

gif

usage

  • php
$eventSource = new EventSource;
$lastEventId = $eventSource->getLastEventId();
$eventSource
	->setLastEventId(1)
	->setData([])
	->setEvent('ProgressEvent')
	->setRetry(1000)
	->output();
  • js
_EventSource("demo.php",
	[
		{
			//Custom Event
			event:'ProgressEvent',
			callback:function(data)
			{
				//code...
			}
		},
		{
			//default Event
			callback:function(data)
			{
			}
		}
	]);

About

use event-source to make a progress bar

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published