当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript actions.setLanguageInfo函数代码示例

本文整理汇总了TypeScript中@nteract/actions.setLanguageInfo函数的典型用法代码示例。如果您正苦于以下问题:TypeScript setLanguageInfo函数的具体用法?TypeScript setLanguageInfo怎么用?TypeScript setLanguageInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setLanguageInfo函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: mergeMap

    mergeMap(msg => {
      const c = msg.content;
      const l = c.language_info;

      const info: KernelInfo = {
        protocolVersion: c.protocol_version,
        implementation: c.implementation,
        implementationVersion: c.implementation_version,
        banner: c.banner,
        helpLinks: c.help_links,
        languageName: l.name,
        languageVersion: l.version,
        mimetype: l.mimetype,
        fileExtension: l.file_extension,
        pygmentsLexer: l.pygments_lexer,
        codemirrorMode: l.codemirror_mode,
        nbconvertExporter: l.nbconvert_exporter
      };

      return of(
        // The original action we were using
        actions.setLanguageInfo({
          langInfo: msg.content.language_info,
          kernelRef,
          contentRef
        }),
        actions.setKernelInfo({
          kernelRef,
          info
        })
      );
    })
开发者ID:kelleyblackmore,项目名称:nteract,代码行数:32,代码来源:kernel-lifecycle.ts

示例2: test

  test("sets the language object", () => {
    const originalState = monocellDocument;

    const action = actions.setLanguageInfo({ langInfo: "test" });

    const state = reducers(originalState, action);
    expect(state.getIn(["notebook", "metadata", "language_info"])).toBe("test");
  });
开发者ID:kelleyblackmore,项目名称:nteract,代码行数:8,代码来源:document.spec.ts

示例3: mergeMap

    mergeMap(msg => {
      const c = msg.content;
      const l = c.language_info;

      const info: KernelInfo = {
        protocolVersion: c.protocol_version,
        implementation: c.implementation,
        implementationVersion: c.implementation_version,
        banner: c.banner,
        helpLinks: c.help_links,
        languageName: l.name,
        languageVersion: l.version,
        mimetype: l.mimetype,
        fileExtension: l.file_extension,
        pygmentsLexer: l.pygments_lexer,
        codemirrorMode: l.codemirror_mode,
        nbconvertExporter: l.nbconvert_exporter
      };

      let result;
      if (!c.protocol_version.startsWith("5")) {
        result = [
          actions.launchKernelFailed({
            kernelRef,
            contentRef,
            error: new Error(
              "The kernel that you are attempting to launch does not support the latest version (v5) of the messaging protocol."
            )
          })
        ];
      } else {
        result = [
          // The original action we were using
          actions.setLanguageInfo({
            langInfo: msg.content.language_info,
            kernelRef,
            contentRef
          }),
          actions.setKernelInfo({
            kernelRef,
            info
          })
        ];
      }

      return of(...result);
    })
开发者ID:nteract,项目名称:nteract,代码行数:47,代码来源:kernel-lifecycle.ts


注:本文中的@nteract/actions.setLanguageInfo函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。