Christian Selig on Nostr: Small addendum to my previous code question, how do I use an @Observable as a ...
Small addendum to my previous code question, how do I use an @Observable as a binding if the object I want to bind is optional? In this case, the object might not be immediately available as it comes in async, but once it comes in, I want it selectable
This code compiles, but the selection is never saved
There's probably a better way to structure this too, in that case I'm all ears!
Gist:
https://gist.github.com/christianselig/792257d1270f0c6dd3ebd9fde062ed51 Published at
2024-02-06 21:25:40Event JSON
{
"id": "e1fcf68f0a1955d606a7685f87097d0b6ec12314912b4a91c94b7f84261793e7",
"pubkey": "de6adda4d139627ce8f9cf05ef27c7cd1de9895363e5f303667f761bec318716",
"created_at": 1707254740,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/users/christianselig/statuses/111886646705359633",
"activitypub"
]
],
"content": "Small addendum to my previous code question, how do I use an @Observable as a binding if the object I want to bind is optional? In this case, the object might not be immediately available as it comes in async, but once it comes in, I want it selectable\n\nThis code compiles, but the selection is never saved\n\nThere's probably a better way to structure this too, in that case I'm all ears!\n\nGist: https://gist.github.com/christianselig/792257d1270f0c6dd3ebd9fde062ed51\n\nhttps://files.mastodon.social/media_attachments/files/111/886/646/441/822/118/original/d04a2e9961aba35c.png",
"sig": "b7f0d42827de2ca33e17580404cbc9f5ea7a91fe26074e62b502e68a5e646b7c240412fce9fcd84577988865b0599d5550b175c22677f1cb93ec0c3520af96e1"
}