Created
May 24, 2019 16:49
-
-
Save ntakouris/daafc3387b7895a16119ac9857c5ee44 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Handlers from './handlers' | |
export default function configureEventSources () { | |
const eventSource = new EventSource(ApiRoutes.EventSource) | |
for (const handler of Handlers) { | |
eventSource.addEventListener(handler.eventType, event => { | |
handler.handle(event) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment