Pomax / socketless

A framework and methodology for writing web socket RPC programs, without writing a single line of web socket or RPC code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add an event for things like React components to listen for webclient updates

Pomax opened this issue · comments

commented

e.g.

const userInterface = ClientServer.generateClientServer(WebClientClass)
const { Component } = require('react');

const MyInterface extends Component {
  constructor(props) {
    super(props);
    userInterface.addEventListner("webclient:update", evt => {
      this.setState(evt.detail.update);
    });
  }
  ...
}
commented

added