https://github.com/emadb/reactive-react
An experimental implementation of a reactive react.js component (using xstream)
https://github.com/emadb/reactive-react
Last synced: about 1 year ago
JSON representation
An experimental implementation of a reactive react.js component (using xstream)
- Host: GitHub
- URL: https://github.com/emadb/reactive-react
- Owner: emadb
- License: mit
- Created: 2016-08-25T15:46:30.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-01T14:47:35.000Z (almost 10 years ago)
- Last Synced: 2025-02-05T05:29:38.151Z (over 1 year ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#Experiments with React.js and xstream
This is a sample implementation of a React.js app that uses Reactive streams ([xstreams](https://github.com/staltz/xstream)) to manage the websocket events from the server.
The server is just a basic express application that starts a couple of timers. On every tick (tick and tack) it sends an event to the connected clients
The client is a react app with just a componenent (Index.js) that starts and stops the timers. The Wrapper.js contains the subscription logic to the websocket.
Every websocket event is transformed into a stream of events. The events are processed by the usual reducers.
To test the app just run the server (node index.js) and start the client (npm run dev). Open the browser on port http://localhost:8080 and press the start button.