O'Reilly logo

Real-time Web Application Development using Vert.x 2.0 by Tero Parviainen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The editor verticle

The first thing we'll do is to create another verticle, the one that will handle mind map editing commands and send out the mind map change events.

Create a file named mindmap_editor.js in the root of the project, and add a basic structure for the command handlers:

var eventBus = require('vertx/event_bus');
eventBus.registerHandler('mindMaps.editor.addNode', function(args) {
});
eventBus.registerHandler('mindMaps.editor.renameNode', function(args) {
});
eventBus.registerHandler('mindMaps.editor.deleteNode', function(args) {
});

The helper functions

Before we implement the command handlers, there are a few utility functions we can add to make our life much easier. The first one is a function that is able to find a node from a mind ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required