當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript effects.call函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。