本文整理匯總了TypeScript中sp-pnp-js.storage.local類的典型用法代碼示例。如果您正苦於以下問題:TypeScript storage.local類的具體用法?TypeScript storage.local怎麽用?TypeScript storage.local使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了storage.local類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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) => {
示例3: Date
this.taxonomyModule.getNavigationTaxonomyNodes(new SP.Guid(termSetId)).then((navigationTree) => {
// Initialize the mainMenu view model
this.initialize(navigationTree);
this.wait(false);
const now: Date = new Date();
// 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) => {