Branch: master
Find file Copy path
ea080a2 Feb 12, 2019
3 contributors

Users who have contributed to this file

@trefis @xclerc @diml
39 lines (30 sloc) 1.84 KB

This directory contains a few examples of how the Incr_dom library can be used.

The examples, explained

(Examples with asterisks in front of their name link to in-depth guides. The rest are stubs.)

  • *Text_input: Start here. This example unpacks a basic Incr_dom application, explaining how all the various parts hang together. (The app implements a model-driven text input.)
  • *Ts_gui: A mockup of a very simple trading-system GUI.
  • Incr_decr: The simplest example, which you should be able to understand after reading through the Text_input guide. Makes use of Incr.Map.mapi’.
  • Incr_decr_rpc: A demo with client, web server, and application server all working together using Async RPC.
  • Entry_table: A curses-like application that lets you move with the keyboard through rows of fake data that are constantly ticking with new information.
  • Event_propagation: An app that demonstrates DOM event propagation.
  • Monitor: Showcases error handling in Incr_dom.
  • Partial_rendering_table: Uses the Partial_render_list module that’s a part of Incr_dom_widgets to partially render a long vertical list.
  • Todo_mvc: Implements the TODO MVC app using Incr_dom.
  • Todo_mvc_rpc: Just like Todo_mvc, but persists its data to an RPC server using websockets.

Build instructions: Running the examples

To run any of these examples, follow the steps below:

  • opam install incr_dom
  • jbuilder build example/incr_decr/{main.bc.js,index.html}
  • Open _build/default/example/incr_decr/index.html in a web browser!