當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。