本文整理匯總了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);
示例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);
示例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>;
示例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;
示例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>;
示例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>;