Skip to content

firasd/react-sync-demo

Repository files navigation

Deploy

React Sync Demo

This is a modified version of the React comment box example from the React tutorial. The example app has been modified to demonstrate syncing updates and offline activity across devices.

Demo GIF

To use

Start the server with:

npm install
node server.js

And visit http://localhost:3000/. Try opening multiple tabs!

You can change the port number by setting the $PORT environment variable before invoking the script, e.g.,

PORT=3001 node server.js

Development

Primus is set to create a new public/scripts/primus.js file when the server starts. If you're using nodemon to restart on file changes:

nodemon --ignore public --ignore comments.json

Webpack config in webpack.config.js runs DefinePlugin to set NODE_ENV to production, and UglifyJS to minify files. Comment out the plugins, then run webpack:

webpack ---watch

About

Code from the React tutorial, modified to demonstrate syncing updates and offline activity across devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published