Fix some collection issues
This commit is contained in:
parent
94b4744bea
commit
3ae442ee1f
|
@ -56,7 +56,7 @@ export interface SquiggleChartProps {
|
||||||
enableLocalSettings?: boolean;
|
enableLocalSettings?: boolean;
|
||||||
/** The project that this execution is part of */
|
/** The project that this execution is part of */
|
||||||
project?: SqProject;
|
project?: SqProject;
|
||||||
/** The name of the squiggle execution source. Defaults to "main" */
|
/** The name of the squiggle execution source. Generates a UUID if not given */
|
||||||
sourceName?: string;
|
sourceName?: string;
|
||||||
/** The sources that this execution continues */
|
/** The sources that this execution continues */
|
||||||
includes?: string[];
|
includes?: string[];
|
||||||
|
|
|
@ -69,11 +69,13 @@ export const useSquiggle = (args: SquiggleArgs) => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
if (!args.sourceName) args.project.clean(result.sourceName);
|
if (result.needsClean) args.project.clean(result.sourceName);
|
||||||
if (args.project.getSource(importSourceName(result.sourceName)))
|
if (args.project.getSource(importSourceName(result.sourceName)))
|
||||||
args.project.clean(result.sourceName);
|
args.project.clean(result.sourceName);
|
||||||
};
|
};
|
||||||
});
|
},
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
[]);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user