當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Reducer.default方法代碼示例

本文整理匯總了TypeScript中redux.Reducer.default方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Reducer.default方法的具體用法?TypeScript Reducer.default怎麽用?TypeScript Reducer.default使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在redux.Reducer的用法示例。


在下文中一共展示了Reducer.default方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: appReducer

  return (state: S, action: any) => {
    if (action.type === STATE_LOADING_DONE) {
      return appReducer(action.payload, action)
    }

    return appReducer(state, action)
  }
開發者ID:jacekjagiello,項目名稱:redux-state-loader,代碼行數:7,代碼來源:redux-state-loader.ts

示例2: it

    it ('should handle DESTROYING and DESTROYED', () => {
      let reduc = reducer(undefined, {
        type: `${C.DESTROYING}`,
        meta: {className}
      })
      verifyClassRecord(reduc.get(className), 'deleting');

      reduc = reducer(reduc, {
        type: `${C.DESTROYED}`,
        meta: {className}
      })
      verifyClassRecord(reduc.get(className));
    });
開發者ID:jasonaden,項目名稱:restore,代碼行數:13,代碼來源:resource-generic-reducer.spec.ts

示例3: it

    it ('should handle FINDING_LIST', () => {   
      let reduc = reducer(undefined, {
        type: `${C.FINDING_LIST}`,
        meta: {uri}
      })
      expect( reduc.get(uri).get('loading') ).toBeTruthy()

      reduc = reducer(reduc, {
        type: `${C.FOUND_LIST}`,
        meta: {uri}
      })
      expect( reduc.get(uri).loading ).toBeFalsy()
    });
開發者ID:jasonaden,項目名稱:restore,代碼行數:13,代碼來源:resource-generic-list-reducer.spec.ts

示例4: it

 it ('should handle FIND_CASE', () => {
   expect(
      reducer(undefined, {
        type: `${FIND}_${type}`,
        payload: {
          result: ['/cases/1'],
          items: {
            '/cases/1': {
              _links: {self: {href: '/cases/1'}}, _embedded: {entries: [{}]}
            }
          }
        }
      })
    ).toEqual(
      {
         result: ['/cases/1'],
         loadingMany: false,
         loadingOne: false,
         deleting: false,
         patching: false,
         adding: false,
         items: {
           '/cases/1': {
              _links: {self: {href: '/cases/1'}}, _embedded: {entries: [{}]}
            }
         },
         meta: {}
       }
    );
 });
開發者ID:jacobmumm,項目名稱:restore,代碼行數:30,代碼來源:resource-reducer.spec.ts

示例5: it

  it ('should handle FINDING_CASE', () => {
    let reduc = reducer(undefined, {
      type: `${C.FINDING}_${type}`
    })

    verifyDefault(reduc, 'loading');
    expect( reduc.loading ).toBeTruthy();
  });
開發者ID:jasonaden,項目名稱:restore,代碼行數:8,代碼來源:resource-list-reducer.spec.ts


注:本文中的redux.Reducer.default方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。