rocore-list
v1.0.2
Published
A nodejs list structure for create message queues.
Downloads
2
Readme
List
A nodejs list structure for create message queues.
example:
import List from 'list';
var indexes = {};
var lhead = List.Node();
var lnode = List.LNode(lhead, 'eventA');
List.insertIndex(indexes, 'eventA', lnode);
List.afterNode(lnode.head.prev, List.Node(0));
List.afterNode(lnode.head.prev, List.Node(1));
List.afterNode(lnode.head.prev, List.Node(2));
var lnode = List.LNode(lhead, 'eventB');
List.insertIndex(indexes, 'eventB', lnode);
List.afterNode(lnode.head.prev, List.Node(10));
List.afterNode(lnode.head.prev, List.Node(11));
List.afterNode(lnode.head.prev, List.Node(12));
for (var lnode of List.gnext(lhead)) {
console.log(lnode.data);
for (var node of List.gnext(lnode.head)) {
console.log(node.data);
}
}