Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket integration #56

Open
th3l0g4n opened this issue Jul 6, 2017 · 2 comments
Open

Websocket integration #56

th3l0g4n opened this issue Jul 6, 2017 · 2 comments

Comments

@th3l0g4n
Copy link

th3l0g4n commented Jul 6, 2017

First of all: Nice work! I like the react / next approach very much.

Im going to setup a Dashboard using your Framework. But regarding Datasources I want the widgets to be updated via Websockets (because of some Security Issues / Rate Limiting / etc.).
I've created a simple node server which fetches data on regular basis and publishes the latest results to connected clients.

I've hacked around a little bit to integrate sockets and everything seems to be fine right now:

...
import io from 'socket.io-client'

const socket = io('http://somehost');

export default () => (
  <Dashboard theme={darkTheme}>
    <JiraIssueCount
      title='My Issues'
      socket={socket}
      event='myproject:issues'
    />

For me the given widget-url is irrelevant, but I can imagine that a widget potentially could determine by itself if it should fetch data via url (the current approach) or via websocket (and the given eventname it should listen to), depending on the props it was given.

@danielbayerlein
Copy link
Owner

@th3l0g4n Thank you for your feature request. 👍 We will test them soon and give you feedback.
/cc @chrishelgert

@danielbayerlein
Copy link
Owner

Socket.io example with Next.js: https://github.com/zeit/next.js/tree/master/examples/with-socket.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants