本文整理匯總了TypeScript中sp-pnp-js.storage.local.delete方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript storage.local.delete方法的具體用法?TypeScript storage.local.delete怎麽用?TypeScript storage.local.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sp-pnp-js.storage.local
的用法示例。
在下文中一共展示了storage.local.delete方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
this.utilityModule.getConfigurationListValuesForLanguage(currentLanguage).then((item) => {
if (item) {
// Get the boolean value
const noCache: boolean = item.ForceCacheRefresh;
// Get the term set id
const termSetId = item.FooterLinksTermSetId;
if (noCache) {
// Clear the local storage value
storage.local.delete(this.localStorageKey);
// Get navigation nodes
this.getNavigationNodes(termSetId);
} else {
const navigationTree = this.utilityModule.isCacheValueValid(this.localStorageKey);
// Check if the local storage value is still valid
if (navigationTree) {
this.initialize(navigationTree);
this.wait(false);
} else {
this.getNavigationNodes(termSetId);
}
}
}
}).catch((errorMesssage) => {
示例2: Date
this.taxonomyModule.getNavigationTaxonomyNodes(new SP.Guid(termSetId)).then((navigationTree: ITaxonomyNavigationNode[]) => {
// Initialize the mainMenu view model
this.initialize(navigationTree);
this.wait(false);
// Publish the data to all subscribers (contextual menu and breadcrumb)
PubSub.publish("navigationNodes", { nodes: navigationTree } );
const now: Date = new Date();
// Clear the local storage value
storage.local.delete(this.localStorageKey);
// Set the navigation tree in the local storage of the browser
storage.local.put(this.localStorageKey, this.utilityModule.stringifyTreeObject(navigationTree), new Date(now.setDate(now.getDate() + 7)));
}).catch((errorMesssage) => {