added test connector, webrtc connector, ideas to apply operations with very low overhead

This commit is contained in:
Kevin Jahns
2015-06-25 18:41:00 +02:00
parent 3142b0f161
commit fec03dc6e1
9 changed files with 419 additions and 464 deletions

27
src/Types/List.js Normal file
View File

@@ -0,0 +1,27 @@
(function(){
class List {
constructor (_model) {
this._model = _model;
}
*val (pos) {
if (pos != null) {
var o = yield* this.Struct.List.ref(this._model, pos);
return o ? o.content : null;
} else {
return yield* this.Struct.List.map(this._model, function(c){return c; });
}
}
*insert (pos, contents) {
yield* this.Struct.List.insert(pos, contents);
}
}
Y.List = function* YList(){
var model = yield* this.Struct.List.create();
return new List(model);
};
Y.List.Create = List;
})();