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