本文整理匯總了TypeScript中redux-saga/utils.cloneableGenerator函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript cloneableGenerator函數的具體用法?TypeScript cloneableGenerator怎麽用?TypeScript cloneableGenerator使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了cloneableGenerator函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: testCloneableGenerator3
function testCloneableGenerator3() {
function* testSaga(n1: number, n2: number, n3: number): SagaIterator {
yield put({type: 'my-action'});
}
// typings:expect-error
cloneableGenerator(testSaga)(1, 2);
cloneableGenerator(testSaga)(1, 2, 3);
}
示例2: testCloneableGenerator1
function testCloneableGenerator1() {
function* testSaga(n1: number): SagaIterator {
yield put({type: 'my-action'});
}
// typings:expect-error
cloneableGenerator(testSaga)();
// typings:expect-error
cloneableGenerator(testSaga)('foo');
cloneableGenerator(testSaga)(1);
}
示例3: testCloneableGenerator4
function testCloneableGenerator4() {
function* testSaga(
n1: number,
n2: number,
n3: number,
n4: number,
): SagaIterator {
yield put({type: 'my-action'});
}
cloneableGenerator(testSaga)(1, 2, 3, 4);
}
示例4: testCloneableGenerator
function testCloneableGenerator() {
function* testSaga(): SagaIterator {
yield put({type: 'my-action'});
}
const cloneableGen = cloneableGenerator(testSaga)();
const value = cloneableGen.next().value;
const clone = cloneableGen.clone();
const cloneVal = clone.next().value;
}
示例5: testCloneableGenerator6Rest
function testCloneableGenerator6Rest() {
function* testSaga(
n1: number,
n2: number,
n3: number,
n4: number,
n5: number,
n6: number,
n7: number,
): SagaIterator {
yield put({type: 'my-action'});
}
cloneableGenerator(testSaga)(1, 2, 3, 4, 5, 6, 7);
}