本文整理汇总了TypeScript中redux-saga/effects.putResolve函数的典型用法代码示例。如果您正苦于以下问题:TypeScript putResolve函数的具体用法?TypeScript putResolve怎么用?TypeScript putResolve使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了putResolve函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: RunnerWithError
export function* RunnerWithError(saga: any) {
try {
const response = yield* saga;
yield putResolve(setResponse(response));
} catch (err) {
yield putResolve({ type: 'FAILED_API_RESPONSE', error: err });
}
}
示例2: testPut
function* testPut(): SagaIterator {
yield put({type: 'my-action'});
// typings:expect-error
yield put(channel, {type: 'my-action'});
yield put(channel, {someField: '--'});
yield put(channel, END);
yield putResolve({type: 'my-action'});
yield putResolve(channel, {someField: '--'});
yield putResolve(channel, END);
}
示例3: testPut
function* testPut(): SagaIterator {
yield put({ type: 'my-action' })
// typings:expect-error
yield put(channel, { type: 'my-action' })
yield put(channel, { someField: '--' })
yield put(channel, END)
// typings:expect-error
yield put(eventChannel, { someField: '--' })
// typings:expect-error
yield put(eventChannel, END)
yield put(multicastChannel, { someField: '--' })
yield put(multicastChannel, END)
yield putResolve({ type: 'my-action' })
}
示例4: SagaInitialized
export function* SagaInitialized(saga: any): SagaIterator {
const response = yield* saga;
yield putResolve(setResponse(response));
}
示例5: SagaRunner
export function* SagaRunner(saga: Effect): SagaIterator {
const response = yield saga;
yield putResolve(setResponse(response));
}