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


TypeScript reduce-reducers.default函數代碼示例

本文整理匯總了TypeScript中reduce-reducers.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: default

export default (
  state: CardContainer = cards,
  action: AnyAction
): CardContainer => reduceReducers(deckReducer, handReducer)(state, action);
開發者ID:zernie,項目名稱:typescript-redux-card-game,代碼行數:4,代碼來源:cardsReducer.ts

示例2: reduceReducers

import {
	Reducer,
	Action,
} from 'redux';
import reduceReducers from 'reduce-reducers';

interface TestStore {
	a: number,
	b: string
}
let firstReducer: (state: TestStore, action: Action) => TestStore = (a, b) => a;
let secondReducer: (state: TestStore, action: Action) => TestStore = (a, b) => a
let finalReducer: (state: TestStore, action: Action) => TestStore = reduceReducers(firstReducer, secondReducer);
開發者ID:Kroisse,項目名稱:DefinitelyTyped,代碼行數:13,代碼來源:reduce-reducers-tests.ts

示例3: reduceReducers

/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License;
 * you may not use this file except in compliance with the Elastic License.
 */

import reduceReducers from 'reduce-reducers';
import { Reducer } from 'redux';

import { loadSourceReducer } from './operations/load';
import { SourceState } from './state';

export const sourceReducer = reduceReducers(loadSourceReducer) as Reducer<SourceState>;
開發者ID:salihkardan,項目名稱:kibana,代碼行數:13,代碼來源:reducer.ts

示例4: reduceReducers

import {
    Reducer,
    Action,
} from 'redux';
import reduceReducers from 'reduce-reducers';

interface TestStore {
    a: number;
    b: string;
}
const firstReducer: (state: TestStore, action: Action) => TestStore = (a, b) => a;
const secondReducer: (state: TestStore, action: Action) => TestStore = (a, b) => a;
const finalReducer: (state: TestStore, action: Action) => TestStore = reduceReducers(firstReducer, secondReducer);
const finalReducerWithState: (state: TestStore, action: Action) => TestStore = reduceReducers(firstReducer, secondReducer, null);

const initialState: TestStore = {
    a: 1,
    b: '2',
};

const finalReducerWithInitialState: (state: TestStore, action: Action) => TestStore = reduceReducers(
    firstReducer,
    secondReducer,
    initialState);

const reducer02: (state: TestStore, action: Action) => TestStore = (a, b) => a;
const reducer03: (state: TestStore, action: Action) => TestStore = (a, b) => a;
const reducer04: (state: TestStore, action: Action) => TestStore = (a, b) => a;
const reducer05: (state: TestStore, action: Action) => TestStore = (a, b) => a;
const reducer06: (state: TestStore, action: Action) => TestStore = (a, b) => a;
const reducer07: (state: TestStore, action: Action) => TestStore = (a, b) => a;
開發者ID:SaschaNaz,項目名稱:DefinitelyTyped,代碼行數:31,代碼來源:reduce-reducers-tests.ts

示例5: reduceReducers

/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License;
 * you may not use this file except in compliance with the Elastic License.
 */

import reduceReducers from 'reduce-reducers';
import { Reducer } from 'redux';

import { loadEntriesReducer } from './operations/load';
import { loadMoreEntriesReducer } from './operations/load_more';
import { LogEntriesState } from './state';

export const logEntriesReducer = reduceReducers(
  loadEntriesReducer,
  loadMoreEntriesReducer
) as Reducer<LogEntriesState>;
開發者ID:elastic,項目名稱:kibana,代碼行數:17,代碼來源:reducer.ts

示例6: reduceReducers

/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License;
 * you may not use this file except in compliance with the Elastic License.
 */

import reduceReducers from 'reduce-reducers';
import { Reducer } from 'redux';

import { loadSummaryReducer } from './operations/load';
import { LogSummaryState } from './state';

export const logSummaryReducer = reduceReducers(
  loadSummaryReducer /*, loadMoreSummaryReducer*/
) as Reducer<LogSummaryState>;
開發者ID:gingerwizard,項目名稱:kibana,代碼行數:15,代碼來源:reducer.ts


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