本文整理匯總了TypeScript中@jupyterlab/docregistry.Context.createCheckpoint方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Context.createCheckpoint方法的具體用法?TypeScript Context.createCheckpoint怎麽用?TypeScript Context.createCheckpoint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@jupyterlab/docregistry.Context
的用法示例。
在下文中一共展示了Context.createCheckpoint方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should delete the given checkpoint', async () => {
await context.initialize(true);
const model = await context.createCheckpoint();
context.deleteCheckpoint(model.id);
const models = await context.listCheckpoints();
expect(models.length).to.equal(0);
});
示例2: it
it('should create a checkpoint for the file', (done) => {
context.createCheckpoint().then(model => {
expect(model.id).to.be.ok();
expect(model.last_modified).to.be.ok();
done();
}).catch(done);
});
示例3: Error
return context.initialize(true).then(() => {
context.createCheckpoint().then(model => {
id = model.id;
return context.listCheckpoints();
}).then(models => {
for (let model of models) {
if (model.id === id) {
return;
}
}
throw new Error('Model not found');
});
});
示例4:
return context.initialize(true).then(() => {
return context.createCheckpoint();
}).then(model => {
示例5:
return context.save().then(() => {
return context.createCheckpoint();
}).then(model => {
示例6:
.then(() => {
return context.createCheckpoint();
})