本文整理匯總了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();
});