How to use the esp-js.SingleModelRouter function in esp-js

To help you get started, we’ve selected a few esp-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github esp / esp-js / examples / esp-js-chat-react-es6 / js / app.jsx View on Github external
import * as esp from 'esp-js'
import React from 'react';
import ReactDOM from 'react-dom';

import * as model from './model';
import * as services from './services';
import {ChatApp} from './components/chatApp';

// export for http://fb.me/react-devtools
window.React = React;

var router = esp.SingleModelRouter.create();
var messageService = new services.MessageService();
var chatAppModel = new model.ChatApp(messageService, router);
router.setModel(chatAppModel);
chatAppModel.initialise();



ReactDOM.render(
    ,
    document.getElementById('react')
);

router.publishEvent("InitEvent", {});
github esp / esp-js / packages / esp-js / examples / esp-chat-react-es6 / js / app.jsx View on Github external
import esp from 'esp-js'
import espDevTools from 'esp-js-devtools';
import React from 'react';
import ReactDOM from 'react-dom';

import model from './model';
import services from './services';
import {ChatApp} from './components/chatApp';

// export for http://fb.me/react-devtools
window.React = React;
espDevTools.registerDevTools();

var router = esp.SingleModelRouter.create();
var messageService = new services.MessageService();
var chatAppModel = new model.ChatApp(messageService, router);
router.setModel(chatAppModel);
chatAppModel.initialise();



ReactDOM.render(
    ,
    document.getElementById('react')
);

router.publishEvent("InitEvent", {});