Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// biome-ignore lint/correctness/useHookAtTopLevel: <explanation>
const { data } = useAsyncData(() => getContinuousKLines(symbol.value, interval.value), {
immediate: false,
default: () => [] satisfies Array<WSContinuousKLineDataK>,
watch: [symbol, interval],
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// biome-ignore lint/correctness/useHookAtTopLevel: <explanation>
const { data } = useAsyncData(() => getContinuousKLines(symbol.value, interval.value), {
immediate: false,
default: () => [] satisfies Array<WSContinuousKLineDataK>,
watch: [symbol, interval],
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// biome-ignore lint/correctness/useHookAtTopLevel: <explanation>
const route = useRoute();
const { data } = useAsyncData(() => getContinuousKLines(route.params.slug, interval.value), {
immediate: false,
default: () => [] satisfies Array<WSContinuousKLineDataK>,
watch: [route, interval],
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// biome-ignore lint/correctness/useHookAtTopLevel: <explanation>
const route = useRoute();
const { data } = useAsyncData(route.params.slug, () => getContinuousKLines(route.params.slug, interval.value), {
immediate: false,
default: () => [] satisfies Array<WSContinuousKLineDataK>,
watch: [route, interval],
});
24 changes: 12 additions & 12 deletions codemods/nuxt/4/shallow-function-reactivity/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function transform(
.forEach((path) => {
const args = path.node.arguments;
if (args[0].type === "ArrowFunctionExpression") {
let slug = "";
let slugVar = "";
root
.find(j.VariableDeclarator, {
init: {
Expand All @@ -74,18 +74,18 @@ export default function transform(
},
})
.forEach((path) => {
slug = path.node.id.name;
slugVar = path.node.id.name;
});
slug += ".params.slug";

// Create the new arguments
const newArg = j.identifier(slug);

path.node.arguments.unshift(newArg);

// Replace the node with the new node, preserving comments
replaceWithComments(path, path.node);
isDirty = true;
if (slugVar) {
const slug = slugVar + ".params.slug";
// Create the new arguments
const newArg = j.identifier(slug);
path.node.arguments.unshift(newArg);
// Replace the node with the new node, preserving comments
replaceWithComments(path, path.node);
isDirty = true;
}
// If no slugVar found, do nothing (skip transformation)
}
});

Expand Down