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


TypeScript terminal.log函數代碼示例

本文整理匯總了TypeScript中@es-git/terminal.log函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript log函數的具體用法?TypeScript log怎麽用?TypeScript log使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了log函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: eventChannel

export default function* withProgress<T>(terminal : Terminal, start : (emit : (v : string) => void) => Promise<T>){
  const channel = yield eventChannel(emit => {
    start(throttle(200, emit)).then(emit, emit);
    return () => {};
  });

  while(true){
    const message : StringOrResult = yield take(channel);
    if(typeof(message) === 'string'){
      yield put(gitProgressMessage(terminal.log(message)));
    }else{
      return message;
    }
  }
}
開發者ID:mariusGundersen,項目名稱:Ekkiog,代碼行數:15,代碼來源:withProgress.ts

示例2: push

function* push(user : OauthData, components : string[]){
  var terminal = new Terminal();
  try{
    yield put(gitProgressStatus('busy'));
    yield put(gitProgressMessage(terminal.logLine(`Pushing...`)));
    yield put(showPopup('GitProgress'));
    yield* withProgress(terminal, emit => storage.push(user, components, emit));
    yield put(gitProgressStatus('success'));
    yield put(hidePopup());
  }catch(e){
    terminal.logLine();
    yield put(gitProgressStatus('failure'));
    yield put(gitProgressMessage(terminal.log(e.message)));
    console.error(e);
  }
}
開發者ID:mariusGundersen,項目名稱:Ekkiog,代碼行數:16,代碼來源:saga.ts

示例3: fetch

function* fetch(){
  var terminal = new Terminal();
  try{
    yield put(gitProgressStatus('busy'));
    yield put(gitProgressMessage(terminal.logLine(`Fetching...`)));
    yield put(showPopup('GitProgress'));
    yield* withProgress(terminal, emit => storage.fetch(emit));
    yield put(gitProgressStatus('success'));
    yield put(hidePopup());
  }catch(e){
    terminal.logLine();
    yield put(gitProgressStatus('failure'));
    yield put(gitProgressMessage(terminal.log(e.message)));
    console.error(e);
  }
}
開發者ID:mariusGundersen,項目名稱:Ekkiog,代碼行數:16,代碼來源:saga.ts

示例4: pull

function* pull(repo : string, name : string, hash? : string){
  var terminal = new Terminal();
  try{
    yield put(gitProgressStatus('busy'));
    yield put(gitProgressMessage(terminal.logLine(`Loading ${name}\nfrom ${repo}`)));
    yield put(showPopup('GitProgress'));
    yield* fetchWithProgress(repo, name, hash, terminal);
    yield put(gitProgressStatus('success'));
    yield put(hidePopup());
    return yield storage.load(repo, name, hash);
  }catch(e){
    terminal.logLine();
    yield put(gitProgressStatus('failure'));
    yield put(gitProgressMessage(terminal.log(e.message)));
    throw e;
  }
}
開發者ID:mariusGundersen,項目名稱:Ekkiog,代碼行數:17,代碼來源:loadForest.ts

示例5:

 await repo.push(`/proxy/${url}.git`, 'refs/heads/master', user, { progress: message => terminal.log(message) })
開發者ID:strangesast,項目名稱:es-git,代碼行數:1,代碼來源:push.ts


注:本文中的@es-git/terminal.log函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。