本文整理匯總了TypeScript中localforage.clear函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript clear函數的具體用法?TypeScript clear怎麽用?TypeScript clear使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了clear函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: cleanEverything
async function cleanEverything() {
const context = getContext();
if (context) {
const adapter = context.owner.lookup('adapter:application');
await adapter.cache.clear();
}
// specifically, offline storage
await localforage.clear();
await localStorage.clear();
}
示例2: logout
@action
logout(this: LogoutController) {
this.currentUser.set('record', undefined);
this.store.unloadAll('user');
this.store.unloadAll('contact');
this.store.unloadAll('identity');
this.store.unloadAll('channel');
localforage.clear();
localStorage.clear();
this.transitionToRoute('application');
}
示例3:
.then(function() {
return localforage.clear();
})
示例4: clearAllDrafts
clearAllDrafts(): void {
Observable.fromPromise(db.clear())
.subscribe(() => console.info('The database has been cleared.'));
}
示例5:
.then(function() {
setItemSubscription.unsubscribe();
clearSubscription.unsubscribe();
return localforage.clear();
})