Format components

This commit is contained in:
Sam Nolan 2022-09-19 14:00:49 +10:00
parent 07731adc6f
commit c20af0edbd
2 changed files with 5 additions and 5 deletions

View File

@ -2,4 +2,4 @@ export { SquiggleChart } from "./components/SquiggleChart";
export { SquiggleEditor } from "./components/SquiggleEditor";
export { SquigglePlayground } from "./components/SquigglePlayground";
export { SquiggleContainer } from "./components/SquiggleContainer";
export * as squiggle from "@quri/squiggle-lang"
export * as squiggle from "@quri/squiggle-lang";

View File

@ -17,9 +17,9 @@ export const useSquiggle = (args: SquiggleArgs) => {
const result = useMemo(
() => {
const project = args.project;
let code = project.getSource(args.sourceName)
if(args.code) {
code = args.code
let code = project.getSource(args.sourceName);
if (args.code) {
code = args.code;
}
project.setSource(args.sourceName, code ?? "");
let includes = args.includes;
@ -29,7 +29,7 @@ export const useSquiggle = (args: SquiggleArgs) => {
if (args.jsImports && Object.keys(args.jsImports).length) {
const importsSource = jsImportsToSquiggleCode(args.jsImports);
project.setSource("imports", importsSource);
includes.push("imports")
includes.push("imports");
}
project.setContinues(args.sourceName, includes);
project.run(args.sourceName);