Coder Social home page Coder Social logo

itproto / lightstreamer-example-stocklist-client-react Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lightstreamer/lightstreamer-example-stocklist-client-react

0.0 1.0 0.0 328 KB

A simple stocklist demo application showing integration between React and the Lightstreamer JS Client

License: Apache License 2.0

JavaScript 75.24% CSS 9.18% HTML 15.58%

lightstreamer-example-stocklist-client-react's Introduction

Lightstreamer - Basic Stock-List Demo - HTML (React) Client

A simple stocklist demo application showing integration between React and the Lightstreamer JavaScript Client library.

Live Demo

screenshot
### View live demo

Details

This demo displays real-time market data for ten stocks, generated by a feed simulator in a similar way to the Lightstreamer - Basic Stock-List Demo - HTML Client.

This page uses the JavaScript Client API for Lightstreamer to handle the communications with Lightstreamer Server and uses React to display the real-time data pushed by Lightstreamer Server.

Each row in the table is implemented as an instance of a React class. The state of these instances is then refreshed through the onItemUpdate callback implementation called by an associated Lightstreamer Subscription; check the Stock.js class to see how this is done.

The demo includes the following client-side functionalities:

  • A Subscription containing 10 items, subscribed to in MERGE mode.

JSX

You will notice that in the sources of this demo there is a jsx folder. This folder contains classes in the jsx format that are then transformed into plain js by Babel and copied into the js folder. When modifying this demo you can either act on the jsx version of these classes or on the js version. If you choose to edit the jsx files you will have to keep them aligned with the js folder using the aforementioned Babel:

Install babel npm install -g babel

Automatically convert the jsx file to js whenever a change is made babel --watch src/jsx --out-dir src/js

Install

If you want to install a version of this demo pointing to your local Lightstreamer Server, follow these steps:

  • Note that, as prerequisite, the Lightstreamer - Stock- List Demo - Java Adapter has to be deployed on your local Lightstreamer Server instance. Please check out that project and follow the installation instructions provided with it, then launch the server.
  • Deploy this demo on the Lightstreamer Server (used as Web server) or in any external Web Server: copy there the contents of the /src folder of this project. The client demo configuration assumes that Lightstreamer Server and this client are launched on the same machine. If you need to target a different Lightstreamer server, please open the src/js/Constants.js and configure the SERVER element accordingly.
  • Lightstreamer JS client, RequireJS and React are currently hot-linked in the html page: you may want to replace them with a local version and/or to upgrade their version.
  • Open your browser and point it to to the newly deployed folder.

See Also

Lightstreamer Adapters Needed by This Demo Client

Related Projects

Lightstreamer Compatibility Notes

  • Compatible with Lightstreamer JavaScript Client library version 6.0 or newer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.