本文整理汇总了TypeScript中@jupyterlab/docmanager.SaveHandler类的典型用法代码示例。如果您正苦于以下问题:TypeScript SaveHandler类的具体用法?TypeScript SaveHandler怎么用?TypeScript SaveHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SaveHandler类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should dispose of the resources used by the handler', () => {
expect(handler.isDisposed).to.equal(false);
handler.dispose();
expect(handler.isDisposed).to.equal(true);
handler.dispose();
expect(handler.isDisposed).to.equal(true);
});
示例2: it
it('should trigger a save', done => {
context.fileChanged.connect(() => {
done();
});
context.model.fromString('bar');
expect(handler.isActive).to.be(false);
handler.saveInterval = 1;
handler.start();
});
示例3: setTimeout
setTimeout(async () => {
await manager.contents.save(context.path, {
type: factory.contentType,
format: factory.fileFormat,
content: 'bar'
});
handler.saveInterval = 1;
handler.start();
context.model.fromString('baz');
}, 1500);
示例4: setTimeout
setTimeout(() => {
manager.contents.save(context.path, {
type: factory.contentType,
format: factory.fileFormat,
content: 'bar'
}).catch(done);
handler.saveInterval = 1;
handler.start();
context.model.fromString('baz');
}, 1500); // The server has a one second resolution for saves.
示例5: it
it('should continue to save', (done) => {
let called = 0;
context.fileChanged.connect(() => {
if (called === 0) {
context.model.fromString('bar');
called++;
} else {
done();
}
});
context.model.fromString('foo');
expect(handler.isActive).to.be(false);
handler.saveInterval = 1;
handler.start();
});