本文整理匯總了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)
}
示例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));
});
示例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()
});
示例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: {}
}
);
});
示例5: it
it ('should handle FINDING_CASE', () => {
let reduc = reducer(undefined, {
type: `${C.FINDING}_${type}`
})
verifyDefault(reduc, 'loading');
expect( reduc.loading ).toBeTruthy();
});