pull/16463/head
ComputerGuy 2 months ago
parent 9905a6b8fd
commit d9db9e3dc2

@ -17,7 +17,10 @@ export function ConstTag(node, context) {
// TODO we can almost certainly share some code with $derived(...)
if (declaration.id.type === 'Identifier') {
const init = build_expression(context, declaration.init, node.metadata.expression);
let expression = create_derived(context.state, b.thunk(init, is_expression_async(init)));
let expression = create_derived(
context.state,
is_expression_async(init) ? b.arrow([], init, true) : b.thunk(init)
);
if (dev) {
expression = b.call('$.tag', expression, b.literal(declaration.id.name));

Loading…
Cancel
Save