How to use the @nteract/commutable.makeCodeCell function in @nteract/commutable

To help you get started, we’ve selected a few @nteract/commutable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nteract / nteract / packages / reducers / src / core / entities / contents / notebook.ts View on Github external
// from === "code"
  if (from === "code") {
    nextState = cleanCellTransient(
      state
        .deleteIn(["notebook", "cellMap", id, "execution_count"])
        .deleteIn(["notebook", "cellMap", id, "outputs"]),
      id
    );
  }

  switch (to) {
    case "code":
      return nextState.setIn(
        ["notebook", "cellMap", id],
        makeCodeCell({
          source: cell.source
        })
      );
    case "markdown":
      return nextState.setIn(
        ["notebook", "cellMap", id],
        makeMarkdownCell({
          source: cell.source
        })
      );
    case "raw":
      return nextState.setIn(
        ["notebook", "cellMap", id],
        makeRawCell({
          source: cell.source
        })