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