本文整理汇总了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);
}