本文整理匯總了TypeScript中ionic-angular.Storage.remove方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Storage.remove方法的具體用法?TypeScript Storage.remove怎麽用?TypeScript Storage.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ionic-angular.Storage
的用法示例。
在下文中一共展示了Storage.remove方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: remove
async remove(id: string) {
const params = {
TableName: this.tableName,
Key: await this.makeKey(id)
};
logger.debug(() => `Removing ${JSON.stringify(params)}`);
await Promise.all([
this.cache.remove(id),
toPromise(this.client.delete(params))
]);
}
示例2: function
global.socket.on('access', function (data) {
if (data.success) {
storage.set('token', data.token);
global.socket.emit('api', {
token: data.token,
module: 'system',
action: 'language',
system: 'mobile',
langCode: global.langCode
});
global.socket.emit('api', {
token: data.token,
module: 'system',
action: 'screen'
});
//-- ข้อมูลจำนวนสินค้าในรถเข็น --//
global.socket.emit('api', {
token: data.token,
module: 'cart',
action: 'summary'
});
}
else {
storage.remove('token');
if (retryCount < 3) {
global.socket.emit('access', { token: '' });
retryCount++;
}
else {
alert(data.error + "\n" + data.errorMessage);
}
}
});
示例3: reset
/**
* Call this to reset the user credentials from the app while debugging
*/
reset() {
this.db.remove("account");
}
示例4: upsertThirdParty
},
// 插入或修改第三方登錄記錄
upsertThirdParty(data) {
const {name} = data;
if (data) {
AKStorage.getThirdParties().then(value => {
let newValue;
if (!value || value.length <= 0 || value.find((tp) => tp.name === name)) {
newValue = [data];
} else {
const position = value.findIndex((tp) => tp.name === name);
newValue = Object.assign([], value);
newValue.splice(position, 1, data);
}
local.setJson(AKStorage.THIRD_PARTY, newValue);
})
}
},
load(key) {
if (store[key]) return Promise.resolve(store[key]);
return local.getJson(key).then(value => store[key] = value);
},
save(key, value) {
store[key] = value;
if (value) local.setJson(key, value);
else local.remove(key);
},
};
示例5: remove
remove(key: string): Promise<any> {
return this.storage.remove(key);
}
示例6: logout
/**
* logout - deletes the cached JWT token
*
* @return {Promise<void>} that resolves when token is removed from cached
*/
logout() {
return this.local.remove('jwt');
}
示例7: reset
reset(): void {
this.storage.remove(this.key);
this.favChanged.emit(null);
}