本文整理汇总了TypeScript中redux-saga/effects.call函数的典型用法代码示例。如果您正苦于以下问题:TypeScript call函数的具体用法?TypeScript call怎么用?TypeScript call使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了call函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: call
const promises = repositories.map(repo => call(fetchConfigs, repo.uri));
开发者ID:elastic,项目名称:kibana,代码行数:1,代码来源:project_config.ts
示例2: fetchPosts
function* fetchPosts() {
yield put( {type: 'REQUEST_POSTS'} )
const posts = yield call(fetchApi, '/posts')
yield put( {type: 'RECEIVE_POSTS', posts} )
}
开发者ID:0815fox,项目名称:DefinitelyTyped,代码行数:5,代码来源:redux-saga-tests.ts
示例3: testCall
function* testCall(): SagaIterator {
// typings:expect-error
yield call();
// typings:expect-error
yield call({});
yield call(() => {});
// typings:expect-error
yield call((a: 'a') => {});
// typings:expect-error
yield call((a: 'a') => {}, 1);
yield call((a: 'a') => {}, 'a');
// typings:expect-error
yield call((a: 'a', b: 'b') => {}, 'a');
// typings:expect-error
yield call((a: 'a', b: 'b') => {}, 'a', 1);
// typings:expect-error
yield call((a: 'a', b: 'b') => {}, 1, 'b');
yield call((a: 'a', b: 'b') => {}, 'a', 'b');
// typings:expect-error
yield call(
(a: 'a', b: 'b', c: 'c', d: 'd', e: 'e', f: 'f', g: 'g') => {},
1, 'b', 'c', 'd', 'e', 'f', 'g'
);
yield call(
(a: 'a', b: 'b', c: 'c', d: 'd', e: 'e', f: 'f', g: 'g') => {},
'a', 'b', 'c', 'd', 'e', 'f', 'g'
);
const obj = {
foo: 'bar',
getFoo(arg: string) {
return this.foo;
},
};
// typings:expect-error
yield call([obj, obj.foo]);
// typings:expect-error
yield call([obj, obj.getFoo]);
yield call([obj, obj.getFoo], 'bar');
// typings:expect-error
yield call([obj, obj.getFoo], 1);
// typings:expect-error
yield call([obj, 'foo']);
// typings:expect-error
yield call([obj, 'getFoo']);
yield call([obj, 'getFoo'], 'bar');
// typings:expect-error
yield call([obj, 'getFoo'], 1);
// typings:expect-error
yield call({context: obj, fn: obj.foo});
// typings:expect-error
yield call({context: obj, fn: obj.getFoo});
yield call({context: obj, fn: obj.getFoo}, 'bar');
// typings:expect-error
yield call({context: obj, fn: obj.getFoo}, 1);
// typings:expect-error
yield call({context: obj, fn: 'foo'});
// typings:expect-error
yield call({context: obj, fn: 'getFoo'});
yield call({context: obj, fn: 'getFoo'}, 'bar');
// typings:expect-error
yield call({context: obj, fn: 'getFoo'}, 1);
}
开发者ID:liesislukas,项目名称:redux-saga,代码行数:73,代码来源:effects.ts
示例4: showPostDeal
function* showPostDeal(action: any): any {
// 衳轏
yield call((path: string): any => history.push(path), '/wiki/wikipost/' + action.payload.postId);
}
开发者ID:weiweiwitch,项目名称:third-lab,代码行数:4,代码来源:posts.ts
示例5: fetchProducts
function* fetchProducts() {
yield put( {type: 'REQUEST_PRODUCTS'} )
const products = yield call(fetchApi, '/products')
yield put( {type: 'RECEIVE_PRODUCTS', products } )
}
开发者ID:0815fox,项目名称:DefinitelyTyped,代码行数:5,代码来源:redux-saga-tests.ts
示例6: updateProxy
function* updateProxy(window: SEnvWindowInterface, isNew: boolean) {
const containsProxy = proxies.has(window.$id);
let proxy: SEnvWindowInterface;
let disposeMirror: () => any;
if (!containsProxy) {
proxy = window.clone();
const position = window.screenLeft || window.screenTop ? { left: window.screenLeft, top: window.screenTop } : (yield call(getBestWindowPosition, window.browserId, (existingWindow: SyntheticWindow) => existingWindow.$id !== window.$id));
proxy.moveTo(position.left, position.top);
proxy.resizeTo(window.innerWidth, window.innerHeight);
proxy.renderer = createRenderer(proxy);
proxy.renderer.start();
disposeMirror = () => {};
yield put(syntheticWindowProxyOpened(proxy, undefined, isNew));
} else {
[proxy, disposeMirror] = proxies.get(window.$id);
}
disposeMirror();
proxies.set(window.$id, [proxy, mirrorWindow(proxy, window)])
};
开发者ID:cryptobuks,项目名称:tandem,代码行数:22,代码来源:synthetic-browser.ts
示例7: handleInitCmd
function* handleInitCmd(action: Action<string>) {
const repoUri = action.payload as string;
yield call(requestRepoInitCmd, repoUri);
}
开发者ID:elastic,项目名称:kibana,代码行数:4,代码来源:repository.ts
示例8: call
querySaga: function* () {
yield call(delay, 0);
yield call(() => queryCounterCalled++);
},
开发者ID:asubiotto,项目名称:cockroach,代码行数:4,代码来源:saga.spec.ts
示例9: handleNextWindowPressed
function* handleNextWindowPressed() {
while(true) {
yield take(NEXT_ARTBOARD_SHORTCUT_PRESSED);
yield call(shiftSelectedArtboard, 1);
}
}
开发者ID:cryptobuks,项目名称:tandem,代码行数:6,代码来源:workspace.ts
示例10: rootSaga
export default function* rootSaga() {
while (true) {
const tickAction = yield call(awaitTick, 15 * 1000);
yield(put(tickAction));
}
}
开发者ID:tylerFowler,项目名称:chrome-dashboard,代码行数:6,代码来源:sagas.ts
注:本文中的redux-saga/effects.call函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论