buttercat1791 on Nostr: Dang. Interestingly, I did try putting a `const newValue = value` inside the callback ...
Dang.
Interestingly, I did try putting a `const newValue = value` inside the callback body in your example, and even that didn't work.
It seems like the Svelte compiler should undefine functions in component bodies, to be thorough, since those functions lose their captured context. Then everything in a component would be tied to its lifecycle, not just some things.
Maybe doing that with functions has other problems, though.
Published at
2025-02-18 01:45:22Event JSON
{
"id": "42bc7c543bc5bfe48940367fb91eabc9167a9280580152b432a2de72e940a214",
"pubkey": "70122128273bdc07af9be7725fa5c4bc0fc146866bec38d44360dc4bc6cc18b9",
"created_at": 1739843122,
"kind": 1,
"tags": [
[
"e",
"7f500ee7f51b63fda17b7c058d00e19f7f22c472819e9aa57d21e31cb6968876",
"",
"root"
],
[
"e",
"d564ee347d3ff9a150a27c982ed68bb99d8b69a82f4ea4673ff127ab10144113"
],
[
"e",
"e58623e7b380fb42cd898cce2b2f706a07af432ea75b1a42163ebc4a9a0934fe",
"",
"reply"
],
[
"p",
"70122128273bdc07af9be7725fa5c4bc0fc146866bec38d44360dc4bc6cc18b9"
],
[
"p",
"d475ce4b3977507130f42c7f86346ef936800f3ae74d5ecf8089280cdc1923e9"
],
[
"p",
"fd208ee8c8f283780a9552896e4823cc9dc6bfd442063889577106940fd927c1"
],
[
"p",
"97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322"
]
],
"content": "Dang.\n\nInterestingly, I did try putting a `const newValue = value` inside the callback body in your example, and even that didn't work.\n\nIt seems like the Svelte compiler should undefine functions in component bodies, to be thorough, since those functions lose their captured context. Then everything in a component would be tied to its lifecycle, not just some things.\n\nMaybe doing that with functions has other problems, though.",
"sig": "8211d61777189b28f73e3a232187de8f399fdbb028877297fb7c216b6270aaa6666b920f6bc26304336da7fef3cccb4beb0b67dab82ebbad2980a6bfc3f4aebd"
}