当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript storage.local.delete方法代码示例

本文整理汇总了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) => {
开发者ID:DI-Paulk,项目名称:PnP,代码行数:35,代码来源:FooterLinksViewModel.ts

示例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) => {
开发者ID:OneBitSoftware,项目名称:PnP,代码行数:18,代码来源:TopNavViewModel.ts


注:本文中的sp-pnp-js.storage.local.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。