当前位置: 首页>>代码示例>>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;未经允许,请勿转载。