/websocket-react-context

Websocket example using the new React Context API

Primary LanguageJavaScript

websocket-react-context

This is a brief example of use websockets with the new React Context API, I tried to follow the react-redux-saga aproach, so you can declare async functions in ./sagas/example.saga.js and call them in ./components/grandParent.js using dispatch.

How call async functions?

See React Context Saga

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.