Skip to content

Websocket integrationย #56

@th3l0g4n

Description

@th3l0g4n

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions