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


TypeScript localforage.ready函数代码示例

本文整理汇总了TypeScript中localforage.ready函数的典型用法代码示例。如果您正苦于以下问题:TypeScript ready函数的具体用法?TypeScript ready怎么用?TypeScript ready使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ready函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: beforeEach

        beforeEach(function() {
            observableLogs = [];
            errorCallCount = 0;
            completeCallCount = 0;

            return localforage
                .ready()
                .then(() => localforage.clear())
                .then(() => {
                    observable = localforage.getItemObservable('UserProfile');
                });
        });
开发者ID:localForage,项目名称:localForage-observable,代码行数:12,代码来源:getItemObservable.spec.ts

示例2: beforeEach

 beforeEach(function() {
     return localforage
         .ready()
         .then(() => localforage.clear())
         .then(() => {
             const observable = localforage.newObservable();
             subscription = observable.subscribe({
                 next: (change: LocalForageObservableChange) =>
                     observableLogs.push(formatChangeArg(change)),
                 error: err => {
                     errorCallCount++;
                     console.error('Found an error!', err);
                 },
                 complete: () => {
                     completeCallCount++;
                 },
             });
         });
 });
开发者ID:localForage,项目名称:localForage-observable,代码行数:19,代码来源:main.spec.ts

示例3: beforeEach

        beforeEach(function() {
            return localforage
                .ready()
                .then(() => localforage.clear())
                .then(() => {
                    const setItemCallObservable = localforage.newObservable({
                        setItem: true,
                        changeDetection: false,
                    });

                    setItemSubscription = setItemCallObservable.subscribe({
                        next: (change: LocalForageObservableChange) =>
                            setItemObservableLogs.push(formatChangeArg(change)),
                        error: err => {
                            errorCallCount++;
                            console.error('Found an error!', err);
                        },
                        complete: () => {
                            completeCallCount++;
                        },
                    });

                    const clearCallObservable = localforage.newObservable({
                        clear: true,
                        changeDetection: false,
                    });

                    clearSubscription = clearCallObservable.subscribe({
                        next: (change: LocalForageObservableChange) =>
                            clearObservableLogs.push(formatChangeArg(change)),
                        error: err => {
                            errorCallCount++;
                            console.error('Found an error!', err);
                        },
                        complete: () => {
                            completeCallCount++;
                        },
                    });
                });
        });
开发者ID:localForage,项目名称:localForage-observable,代码行数:40,代码来源:observing-methods.spec.ts

示例4: it

 it('should get ready', function() {
     return m.chai.expect(localforage.ready()).to.eventually.be.fulfilled;
 });
开发者ID:localForage,项目名称:localForage-observable,代码行数:3,代码来源:main.spec.ts


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