How to use the codesandbox-api.actions.editor function in codesandbox-api

To help you get started, we’ve selected a few codesandbox-api 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 codesandbox / codesandbox-client / src / sandbox / react-error-overlay / components / frame.js View on Github external
onSourceClick = () => {
        const manager = getCurrentManager();
        if (manager) {
          const tModule = manager.resolveTranspiledModule(
            sourceFileName.replace(location.origin, ''),
            '/'
          );

          dispatch(
            actions.editor.openModule(
              // A module has a parent when it has been generated by a module,
              // Vue is an example of this: SFC's generate submodules
              tModule.module.parent
                ? tModule.module.parent.path
                : tModule.module.path,
              window.encodeURIComponent(sourceLineNumber || 1)
            )
          );
        }
      };
    }
github codesandbox / codesandbox-client / packages / sandbox-hooks / react-error-overlay / components / frame.js View on Github external
onSourceClick = () => {
        const manager = getCurrentManager();
        if (manager) {
          const tModule = manager.resolveTranspiledModule(
            sourceFileName.replace(location.origin, '').replace('file://', ''),
            '/'
          );

          dispatch(
            actions.editor.openModule(
              // A module has a parent when it has been generated by a module,
              // Vue is an example of this: SFC's generate submodules
              tModule.module.parent
                ? tModule.module.parent.path
                : tModule.module.path,
              window.encodeURIComponent(sourceLineNumber || 1)
            )
          );
        }
      };
    }
github davestewart / axios-actions / demo / src / core / components / nav / ViewCode.vue View on Github external
open() {
        this.isCodeSandbox
          ? dispatch(actions.editor.openModule(this.url))
          : window.open(this.url, '_github')
      },
    }
github codesandbox / codesandbox-client / packages / app / src / app / components / Preview / DevTools / React-Devtools / index.tsx View on Github external
function viewElementSourceFunction(id: string, data: any) {
    const { source } = data;

    if (source) {
      dispatch(actions.editor.openModule(source.fileName, source.lineNumber));
    }
  }

codesandbox-api

[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) [![Greenkeeper badge](https://badges.greenkeeper.io/alexjoverm/typescript-library-starter.svg)](https://greenkeeper.io/) [![Travi

MIT
Latest version published 3 years ago

Package Health Score

73 / 100
Full package analysis

Similar packages