Passing strings to function calls #177
Replies: 1 comment
-
|
Hi @brandonpittman, sorry for the delay. The default heuristic is that expressions (values not assigned to a variable) in the script block are not extracted. Since this seems to be a one-off situation, the cleaner way seems to be the include comment. When you extract it to a variable, it is auto wrapped inside |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Am I correct in thinking that:
…would not extract the
"Something"?Doing the above doesn't appear to get extracted and if I set it in a variable and pass it to the function results in Svelte warning me about only the initial state of the generated
$derived()being captured.I can do this:
…but that feels like introducing tool-specific hacks for no good reason. What's the best way to handle passing text to function calls (like context setters).
Beta Was this translation helpful? Give feedback.
All reactions