An open API service indexing awesome lists of open source software.

https://github.com/hassantauqeer/react-crossbar

This repo shows how to connect crossbar.io with ReactJS product.
https://github.com/hassantauqeer/react-crossbar

autobahn crossbar react reactjs sockets

Last synced: 21 days ago
JSON representation

This repo shows how to connect crossbar.io with ReactJS product.

Awesome Lists containing this project

README

        


react boilerplate banner
react boilerplate banner



Start your next project with react-boilerplate and crossbar

React-boilerplate doesn't need any introduction credit goes to mxstbr, this repo is to describe implementation of crossbar in react-boilerplate

## Crossbar Implementation
```bash
npm install --save autobahn-react
```

```js
browserInitialize: function browserInitialize(port, path, realm) {
return this.initialize('ws://' + document.location.hostname + ':' + port + '/' + path, realm);
```
change this line
```bash
return this.initialize('ws://' + document.location.hostname + ':' + port + '/' + path, realm);
```
with your crossbar (localhoat)

```bash
return this.initialize('ws://localhost:' + port + '/' + path, realm);
```
1. then go to app.js in app
2. Import Autobahn
3. Create connection & dispatch the connected event(Autobahn Object) to App(Main) Store
4. Then use that dispatched Autobahn Object wherever you want to subscribe in app like i did in HomePage container

## Collaborations
A little work by me to help others, although there will be plenty of mistakes, thats why collaborations are highly Welcome. Thanks!