本文整理匯總了TypeScript中@jupyterlab/docmanager.SaveHandler.start方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript SaveHandler.start方法的具體用法?TypeScript SaveHandler.start怎麽用?TypeScript SaveHandler.start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@jupyterlab/docmanager.SaveHandler
的用法示例。
在下文中一共展示了SaveHandler.start方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should trigger a save', () => {
let promise = signalToPromise(context.fileChanged);
context.model.fromString('bar');
expect(handler.isActive).to.equal(false);
handler.saveInterval = 1;
handler.start();
return promise;
});
示例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();
});