本文整理汇总了TypeScript中@jupyterlab/observables.ObservableUndoableList类的典型用法代码示例。如果您正苦于以下问题:TypeScript ObservableUndoableList类的具体用法?TypeScript ObservableUndoableList怎么用?TypeScript ObservableUndoableList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ObservableUndoableList类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should dispose of the resources used by the list', () => {
let list = new ObservableUndoableList(serializer);
list.dispose();
expect(list.isDisposed).to.be(true);
list.dispose();
expect(list.isDisposed).to.be(true);
});
示例2: it
it('should redo a push', () => {
const list = new ObservableUndoableList(serializer);
list.push(serializer.fromJSON(value));
list.undo();
list.redo();
expect(list.length).to.equal(1);
});
示例3: it
it('should undo a move', () => {
let items = [serializer.fromJSON(value),
serializer.fromJSON(value),
serializer.fromJSON(value)];
let list = new ObservableUndoableList(serializer);
list.pushAll(items);
list.move(1, 2);
list.undo();
expect((list.get(1) as any)['count']).to.be((items[1] as any)['count']);
});